

#[cfg(test)]
#[cfg(feature = "all_tests")]
mod generated_tests {
    use array::dense::*;
    use array::traits::*;



    #[test]
    fn test_matmul_0() {

        let mut arr1 = Array::from(vec![0.7488038825386119,
                                        0.4985070123025904,
                                        0.22479664553084766,
                                        0.19806286475962398,
                                        0.7605307121989587]);
        arr1.reshape(5, 1);

        let mut arr2 = Array::from(vec![0.16911083656253545, 0.08833981417401027]);
        arr2.reshape(1, 2);

        let mut result = Array::from(vec![0.12663085099737917,
                                          0.06614919583623838,
                                          0.08430293788278122,
                                          0.044038016831251886,
                                          0.03801554878217339,
                                          0.019858493893135938,
                                          0.033494576751472334,
                                          0.01749683666763731,
                                          0.12861398497146678,
                                          0.0671851417892837]);
        result.reshape(5, 2);

        assert!(allclose(&arr1.dot(&arr2), &result));
    }



    #[test]
    fn test_matmul_1() {

        let mut arr1 = Array::from(vec![0.8166018352206666,
                                        0.3360715844645519,
                                        0.8908165306793224,
                                        0.19812181303297027,
                                        0.03061665387269341,
                                        0.8776149398973291,
                                        0.7274355137182333,
                                        0.5408809312773927,
                                        0.1314581524025229,
                                        0.4136673744184527,
                                        0.7787288082639929,
                                        0.5839013656536759,
                                        0.18263143630201495,
                                        0.8260822477490752,
                                        0.10540183348780108,
                                        0.28357667858256574,
                                        0.06556326635477827,
                                        0.05644418747007063,
                                        0.7654558182151854,
                                        0.01178802938496426]);
        arr1.reshape(5, 4);

        let mut arr2 = Array::from(vec![0.6119433411110109,
                                        0.3318822556677169,
                                        0.559648365456308,
                                        0.33549964651986997]);
        arr2.reshape(4, 1);

        let mut result = Array::from(vec![1.1762640644768163,
                                          0.8985739408054911,
                                          0.8494468087735784,
                                          0.5400499703258541,
                                          0.4911948057091634]);
        result.reshape(5, 1);

        assert!(allclose(&arr1.dot(&arr2), &result));
    }



    #[test]
    fn test_matmul_2() {

        let mut arr1 = Array::from(vec![0.8286813263076767,
                                        0.04689631938924976,
                                        0.6262871483113925,
                                        0.5475861559192435,
                                        0.8192869956700687,
                                        0.1989475396788123,
                                        0.8568503024577332,
                                        0.3516526394320879,
                                        0.7546476915298572,
                                        0.2959617068796787,
                                        0.8839364795611863,
                                        0.3255116378322488,
                                        0.16501589771914849,
                                        0.3925292439465873,
                                        0.0934603745586503,
                                        0.8211056578369285,
                                        0.15115201964256386,
                                        0.3841144486921996,
                                        0.9442607122388011,
                                        0.9876254749018722,
                                        0.4563045470947841,
                                        0.8261228438427398,
                                        0.25137413420705934,
                                        0.5973716482308843,
                                        0.9028317603316274,
                                        0.5345579488018151,
                                        0.5902013629854229,
                                        0.03928176722538734,
                                        0.3571817586345363,
                                        0.07961309015596418,
                                        0.30545991834281827,
                                        0.330719311982132,
                                        0.7738302962105958,
                                        0.039959208689977266,
                                        0.42949217843163834,
                                        0.3149268718426883,
                                        0.6364911430675446,
                                        0.34634715008003303,
                                        0.04309735620499444,
                                        0.879915174517916,
                                        0.763240587143681,
                                        0.8780966427248583,
                                        0.41750914383926696,
                                        0.6055775643937568,
                                        0.5134666274082884,
                                        0.5978366479629736,
                                        0.2622156611319503,
                                        0.30087130894070724,
                                        0.025399782050106068,
                                        0.30306256065103476,
                                        0.24207587540352737,
                                        0.5575781886626442,
                                        0.5655070198881675,
                                        0.47513224741505056,
                                        0.2927979762895091,
                                        0.06425106069482445]);
        arr1.reshape(7, 8);

        let mut arr2 = Array::from(vec![0.9788191457576426,
                                        0.33970784363786366,
                                        0.4950486308824543,
                                        0.9770807259226818,
                                        0.4407738249006665,
                                        0.3182728054789512,
                                        0.5197969858753801,
                                        0.5781364298824675,
                                        0.8539337505004864,
                                        0.06809727353795003,
                                        0.46453080777933253,
                                        0.7819491186191484,
                                        0.7186028103822503,
                                        0.5860219800531759,
                                        0.037094413234407875,
                                        0.350656391283133,
                                        0.563190684492745,
                                        0.29972987242456284,
                                        0.5123341532735493,
                                        0.6734669252847205,
                                        0.1591937333780935,
                                        0.05047767015399762,
                                        0.33781588706467947,
                                        0.10806377277945256,
                                        0.17890280857109042,
                                        0.8858270961677057,
                                        0.3653649712141158,
                                        0.21876934917953672,
                                        0.7524961702186028,
                                        0.10687958439356915,
                                        0.7446032407755606,
                                        0.46978529344049447,
                                        0.5982556712791092,
                                        0.14762019228529766,
                                        0.18403482209315125,
                                        0.6450721264682419,
                                        0.048628006263405577,
                                        0.24861250780276944,
                                        0.5424085162280042,
                                        0.2267733432700092,
                                        0.3814115349046321,
                                        0.9222327869035463,
                                        0.9253568728677768,
                                        0.566749924575,
                                        0.5334708849890026,
                                        0.014860024633228108,
                                        0.977899263402005,
                                        0.5730289040331858,
                                        0.791756996276624,
                                        0.5615573602763689,
                                        0.8773352415649347,
                                        0.5841958285306755,
                                        0.7088498263689552,
                                        0.14853345135645857,
                                        0.4284507389678964,
                                        0.6938900663424117,
                                        0.10461974452285316,
                                        0.4396052377745905,
                                        0.16620214770453368,
                                        0.5069786292640474,
                                        0.8190358641362125,
                                        0.09010673472443853,
                                        0.8000687506941452,
                                        0.5651263539578045,
                                        0.5893477116806074,
                                        0.1981006572162689,
                                        0.4361182553388343,
                                        0.29590376222083736,
                                        0.03755767594167769,
                                        0.030684840372946276,
                                        0.45310500020123345,
                                        0.7448640769500677]);
        arr2.reshape(8, 9);

        let mut result = Array::from(vec![1.8636289999496571,
                                          2.3371757355482212,
                                          1.3228318747394487,
                                          2.1560848952544682,
                                          1.5322326485666165,
                                          2.038490862178821,
                                          2.2270085613097286,
                                          2.002957804581816,
                                          2.717839825753671,
                                          1.8008296125574192,
                                          2.2077383553073697,
                                          1.2673980008136507,
                                          1.9844205221589646,
                                          1.499465602389063,
                                          1.1162071011585086,
                                          1.1859907055632388,
                                          2.1981280821647404,
                                          2.0987873423677605,
                                          1.3537041135449412,
                                          3.0566868346154705,
                                          1.4965970972995377,
                                          2.335362973616119,
                                          1.9311801775721935,
                                          2.0507318976290474,
                                          1.6570616594938936,
                                          2.4594555568901653,
                                          2.238503177597988,
                                          1.5674097294685154,
                                          1.5555758505622812,
                                          1.2999294023597958,
                                          1.747863709065677,
                                          1.25861045205271,
                                          0.9609906345150541,
                                          1.4054837803795253,
                                          1.7893045900125117,
                                          1.8652611203215783,
                                          1.6009272519838944,
                                          1.853081650709432,
                                          1.2388871662996581,
                                          1.8622396990960361,
                                          1.3623303471332544,
                                          1.4283433038837052,
                                          1.3931878809354605,
                                          1.9171142108524422,
                                          2.1137404030753286,
                                          1.4694860154230864,
                                          2.475600057669217,
                                          1.9037789114626875,
                                          2.6850090288339303,
                                          1.940704484426214,
                                          1.8251757105090112,
                                          1.9171191588033278,
                                          2.2918185772743653,
                                          2.2547501383738506,
                                          0.487823715947414,
                                          1.5782753643018803,
                                          0.9700452783614332,
                                          1.3311609808148681,
                                          1.0826966847064747,
                                          1.4682947509094475,
                                          1.2877410689415112,
                                          1.2152117412030659,
                                          1.2150222079096793]);
        result.reshape(7, 9);

        assert!(allclose(&arr1.dot(&arr2), &result));
    }



    #[test]
    fn test_matmul_3() {

        let mut arr1 = Array::from(vec![0.02343208967343946,
                                        0.9351290211010858,
                                        0.20959771262641858,
                                        0.5767729792632846,
                                        0.5810473308202846,
                                        0.23392116115287398,
                                        0.4829791904668277,
                                        0.5470433236745386,
                                        0.8718123119359061,
                                        0.9640360264185229,
                                        0.16161057694639414,
                                        0.016890216716548112,
                                        0.017029974490559763,
                                        0.1988350364892616,
                                        0.8985460488111815,
                                        0.7858558372753476,
                                        0.6859219733533566,
                                        0.3265324364801837,
                                        0.4084904227904791,
                                        0.5738732696838558,
                                        0.000986666356991961,
                                        0.7498525406321818,
                                        0.7508390254874455,
                                        0.3832725488828932,
                                        0.37293850687954866,
                                        0.8426818713989127,
                                        0.759296481115939,
                                        0.16578250597291844,
                                        0.7541563261727,
                                        0.5959939345983292,
                                        0.9268088739455752,
                                        0.4150991819310216,
                                        0.09685600409892259,
                                        0.8961532323425018,
                                        0.7099478870139949,
                                        0.4230056469476162]);
        arr1.reshape(6, 6);

        let mut arr2 = Array::from(vec![0.29536985892080336,
                                        0.17858845187204242,
                                        0.9284958901211762,
                                        0.2780497576026819,
                                        0.44770886382163244,
                                        0.6098735604012505]);
        arr2.reshape(6, 1);

        let mut result = Array::from(vec![0.9317089507421266,
                                          1.4005326320783942,
                                          1.5995799679610947,
                                          1.0024604111768296,
                                          1.7128709075027795,
                                          1.262818839226749]);
        result.reshape(6, 1);

        assert!(allclose(&arr1.dot(&arr2), &result));
    }



    #[test]
    fn test_matmul_4() {

        let mut arr1 = Array::from(vec![0.9659462515078151,
                                        0.31700156230578813,
                                        0.8655526182272831,
                                        0.310283706940119]);
        arr1.reshape(4, 1);

        let mut arr2 = Array::from(vec![0.025263945431817092,
                                        0.049195157773728626,
                                        0.1846268380142655,
                                        0.06903334161725405,
                                        0.2574754234045431,
                                        0.9135817315706746,
                                        0.4578495119744105,
                                        0.13021178947959489]);
        arr2.reshape(1, 8);

        let mut result = Array::from(vec![0.02440361338816171,
                                          0.04751987824386872,
                                          0.17833960210762034,
                                          0.066682497564245,
                                          0.24870742009300598,
                                          0.882470849056712,
                                          0.4422580198463643,
                                          0.12577758994993943,
                                          0.008008710171894197,
                                          0.015594941872151713,
                                          0.05852699609409984,
                                          0.021883677143858717,
                                          0.08162011147458445,
                                          0.289606836201931,
                                          0.14513901059683076,
                                          0.04127734069566397,
                                          0.021867274115260495,
                                          0.042580997615155096,
                                          0.15980424303827198,
                                          0.05975198958179271,
                                          0.22285852685698057,
                                          0.7907530597256124,
                                          0.3962928438435348,
                                          0.11270515530812315,
                                          0.007838990640517091,
                                          0.015264455917536529,
                                          0.05728669969969917,
                                          0.021419921139465174,
                                          0.0798904288199383,
                                          0.28346952626452165,
                                          0.1420632437961445,
                                          0.040402596727035084]);
        result.reshape(4, 8);

        assert!(allclose(&arr1.dot(&arr2), &result));
    }



    #[test]
    fn test_matmul_5() {

        let mut arr1 = Array::from(vec![0.09867089880131952,
                                        0.8213681077532083,
                                        0.4104176887058165,
                                        0.40899220374056944,
                                        0.5390292018227953,
                                        0.6081689510093544,
                                        0.5686751048128866,
                                        0.07936628579412774,
                                        0.987080075759515,
                                        0.36585267914564845,
                                        0.30857405385931824,
                                        0.40176833801872014,
                                        0.038390814451594424,
                                        0.05220999047317065,
                                        0.20963889655800072,
                                        0.26711682076210697,
                                        0.020180928798586684,
                                        0.4111256911223199,
                                        0.5407066929358788,
                                        0.7234816370105102,
                                        0.8832868193093703,
                                        0.1549640073546541,
                                        0.45724875650392716,
                                        0.9689067573450633,
                                        0.3139064860941967,
                                        0.9451165184585447,
                                        0.26973426064522454,
                                        0.04962017253947604,
                                        0.6314965806026245,
                                        0.3775599470346803,
                                        0.22784243971893103,
                                        0.23790885462249955,
                                        0.24518122305941803,
                                        0.6625928898409245,
                                        0.34850521476817065,
                                        0.3848432113135175,
                                        0.8204147962839342,
                                        0.8950223079366563,
                                        0.2729546367619464,
                                        0.875009045353079,
                                        0.8780783411312396,
                                        0.7863287989694552,
                                        0.005609078913205612,
                                        0.25295793983266146,
                                        0.1933664500634107,
                                        0.4109221319177436,
                                        0.4467061619964898,
                                        0.7937446692135952,
                                        0.7232333002390631,
                                        0.00010632549643607714,
                                        0.5637395405854435,
                                        0.8285313743206492,
                                        0.002370990881480961,
                                        0.3157881613333898,
                                        0.7115358139407235,
                                        0.3263716243060254]);
        arr1.reshape(7, 8);

        let mut arr2 = Array::from(vec![0.4225522573344933,
                                        0.4188267989763754,
                                        0.8685508176395133,
                                        0.10833073330879162,
                                        0.5736182708950517,
                                        0.6022095859451538,
                                        0.07127344705295213,
                                        0.3046527511400685,
                                        0.4713651000258645,
                                        0.42877537239025043,
                                        0.7639600082043996,
                                        0.23942577748347948,
                                        0.5932693472563628,
                                        0.21598770917172883,
                                        0.32855583463033844,
                                        0.06827274752131252,
                                        0.7256537772527641,
                                        0.6122399098558322,
                                        0.11700493983201266,
                                        0.687366499029156,
                                        0.14501861866387533,
                                        0.9625283238089534,
                                        0.7772782160176988,
                                        0.9033500334815702,
                                        0.7843792250906823,
                                        0.5086868668262204,
                                        0.13197066408625446,
                                        0.22981003079385764,
                                        0.616745871837231,
                                        0.7689436658715406,
                                        0.5374050367007986,
                                        0.36771649094937364,
                                        0.6696855200483852,
                                        0.4067513089676259,
                                        0.3569502760835511,
                                        0.7099511276575683,
                                        0.5572719426485148,
                                        0.996989762789397,
                                        0.3738451243037514,
                                        0.700930402750168,
                                        0.5439887620500772,
                                        0.4443834577348068,
                                        0.3007102925822702,
                                        0.610080439674346,
                                        0.6483314856533615,
                                        0.8706156473347222,
                                        0.5942777205222456,
                                        0.15171964914679803,
                                        0.8187215707992948,
                                        0.16034803009580723,
                                        0.6606953421294681,
                                        0.17663504593674884,
                                        0.48419865845573695,
                                        0.7135545580113779,
                                        0.4812012850088755,
                                        0.14075845193491954,
                                        0.7307873881381384,
                                        0.8122958951949274,
                                        0.7238205196421121,
                                        0.6717322953422301,
                                        0.26411314241336714,
                                        0.2760733247794557,
                                        0.8416991944273465,
                                        0.5157516549724572,
                                        0.828089476597136,
                                        0.6297307138355206,
                                        0.5418873200988024,
                                        0.8256115586513965,
                                        0.6778163004125543,
                                        0.6942766250514122,
                                        0.21917850452044407,
                                        0.9003573954833297]);
        arr2.reshape(8, 9);

        let mut result = Array::from(vec![1.6803351750539757,
                                          2.247766093561234,
                                          1.4157121595594613,
                                          2.49349776386414,
                                          1.57129570748317,
                                          2.051076084145239,
                                          1.0262032009614412,
                                          1.7785703722556165,
                                          2.227454655753151,
                                          1.0078900228533691,
                                          1.4728123931861954,
                                          1.6422965988599865,
                                          1.2215946516109906,
                                          1.4343431924055943,
                                          1.635873429131049,
                                          0.7623772214170802,
                                          1.0317013918226794,
                                          1.4943214632150388,
                                          1.7612257637851552,
                                          2.979826569861099,
                                          2.048716934339299,
                                          2.7977972034175536,
                                          2.422942835535734,
                                          2.5789750781049623,
                                          1.8343434763942912,
                                          1.7902875438482349,
                                          2.7866803710798513,
                                          1.493812919982045,
                                          2.1525646617096337,
                                          1.1858886743098567,
                                          1.9467542719117805,
                                          1.3775061384047076,
                                          1.6208417630990763,
                                          0.8005944987286125,
                                          1.619505514578425,
                                          1.8822340533283746,
                                          2.335971112794045,
                                          3.1986276322493823,
                                          1.9110490829576317,
                                          2.965623514350233,
                                          2.2059502986105493,
                                          2.670259038827183,
                                          1.5769963919014895,
                                          2.0711843722374064,
                                          3.0285625734060786,
                                          1.8568246117442722,
                                          2.28550826921577,
                                          2.1071735644131957,
                                          1.967912402586874,
                                          1.920635346531573,
                                          2.157112561115595,
                                          1.0233489855241942,
                                          1.5454905755043362,
                                          2.5848723844120904,
                                          1.348984639587682,
                                          1.7619290051916898,
                                          2.1213423004624286,
                                          2.0813224269950745,
                                          1.9941361241740647,
                                          2.40855754617413,
                                          1.3017567818287086,
                                          1.2252439751669943,
                                          2.12320539560902]);
        result.reshape(7, 9);

        assert!(allclose(&arr1.dot(&arr2), &result));
    }



    #[test]
    fn test_matmul_6() {

        let mut arr1 = Array::from(vec![0.1531969301964562,
                                        0.3438098945485848,
                                        0.008466911174788372,
                                        0.13208192652086204,
                                        0.7255432465439993,
                                        0.8295890150299017,
                                        0.013528181111777338,
                                        0.06701847975796726,
                                        0.11185484645860788,
                                        0.29526480118342946,
                                        0.13478392460548572,
                                        0.6648510436552199,
                                        0.3165906947458056,
                                        0.32703865522538256,
                                        0.16205831294146922,
                                        0.06406691280517696,
                                        0.7413369011627189,
                                        0.7107522445972044,
                                        0.49148594359857856,
                                        0.859942195700386,
                                        0.5076293778149958,
                                        0.5760300907293111,
                                        0.253897470823194,
                                        0.656954217532432,
                                        0.6522032924009218,
                                        0.06379972855892946,
                                        0.03534275172587109,
                                        0.6516784782252761]);
        arr1.reshape(4, 7);

        let mut arr2 = Array::from(vec![0.3273150721309004,
                                        0.9145882805277057,
                                        0.68681698320307,
                                        0.604468051784674,
                                        0.9648853179875961,
                                        0.838491762190224,
                                        0.6429768520274158,
                                        0.2552744896661301,
                                        0.3409119855738164,
                                        0.25073788340317094,
                                        0.2861426173287246,
                                        0.9237574440277018,
                                        0.3062530966510215,
                                        0.5681850195842788,
                                        0.3678206969289417,
                                        0.7946997153513944,
                                        0.03405577520367198,
                                        0.21627897524280026,
                                        0.7102738447959042,
                                        0.6278623555090681,
                                        0.18931700678206653,
                                        0.7641131314841632,
                                        0.8961528431903454,
                                        0.6688551802336785,
                                        0.22077251068170267,
                                        0.43766394922338014,
                                        0.5699983336709824,
                                        0.11098208379454733]);
        arr2.reshape(7, 4);

        let mut result = Array::from(vec![0.609968651593792,
                                          1.302304235850313,
                                          1.6437692539934388,
                                          1.3050729746393772,
                                          0.426579726955514,
                                          0.8345374005822861,
                                          1.1943651139871583,
                                          1.1144137232745686,
                                          0.8768722922809966,
                                          1.7772185144127468,
                                          2.035132564640786,
                                          2.3040638893066854,
                                          1.0099645442190333,
                                          1.6010373354151108,
                                          1.4351973471200927,
                                          1.6741987195645516]);
        result.reshape(4, 4);

        assert!(allclose(&arr1.dot(&arr2), &result));
    }



    #[test]
    fn test_matmul_7() {

        let mut arr1 = Array::from(vec![0.4299261028565723,
                                        0.838846587613526,
                                        0.5373540254236295,
                                        0.2504239331501743,
                                        0.058894011440773775,
                                        0.09194928490764764,
                                        0.17419994314144638,
                                        0.43925435059827533,
                                        0.8109342250751058,
                                        0.9104021236063347,
                                        0.5760907120119877,
                                        0.2911544297803492,
                                        0.6517863717812156,
                                        0.6379207007555681,
                                        0.5035747397173306,
                                        0.9655527156217962,
                                        0.8066911496104903,
                                        0.9285193564036172,
                                        0.613935126664438,
                                        0.9820039163431012,
                                        0.7149879558453262,
                                        0.008659271417291059,
                                        0.28814558099381116,
                                        0.8413986575018212,
                                        0.44317708702734737,
                                        0.17304972347660363,
                                        0.11452711222626355,
                                        0.7978805960212307,
                                        0.6489051514456138,
                                        0.501745998146996,
                                        0.2856402082321652,
                                        0.6366958284853916,
                                        0.3683419053302235,
                                        0.5395385433522519,
                                        0.7620668019798759,
                                        0.8398874811543805,
                                        0.10495741202168796,
                                        0.5106313083459157,
                                        0.6454886627441757,
                                        0.1530668142526591,
                                        0.0017596491043597728,
                                        0.9670457532300503,
                                        0.8078665332650923,
                                        0.27406758936347153,
                                        0.27908960707212593,
                                        0.12067964142197818,
                                        0.48068826499085704,
                                        0.9323019787625625,
                                        0.9149274257682686,
                                        0.24387509597581103,
                                        0.3948582964158739,
                                        0.970239530226589,
                                        0.2756196336037614,
                                        0.9378494408664138,
                                        0.7690121570235064,
                                        0.8847186881060606]);
        arr1.reshape(8, 7);

        let mut arr2 = Array::from(vec![0.8710049752440003,
                                        0.14647095922681508,
                                        0.7891887879251763,
                                        0.9092222456715098,
                                        0.838170548530705,
                                        0.7120311863871623,
                                        0.3073794185374644,
                                        0.35378455477098936,
                                        0.2363533952237783,
                                        0.08981163906322553,
                                        0.19447817432203818,
                                        0.6158078753671168,
                                        0.9320836755651093,
                                        0.6910839497831097]);
        arr2.reshape(7, 2);

        let mut result = Array::from(vec![1.7580164294212424,
                                          1.4791778570089325,
                                          2.752892631476799,
                                          2.5220851383945195,
                                          3.1646845665873133,
                                          3.008527112889941,
                                          1.8832680118917628,
                                          1.6566190474769846,
                                          2.298591691687037,
                                          1.8718678795486745,
                                          2.378671075848116,
                                          1.4935386603259162,
                                          2.3386795736316057,
                                          1.85851439322815,
                                          2.617831990792432,
                                          2.3522937628261262]);
        result.reshape(8, 2);

        assert!(allclose(&arr1.dot(&arr2), &result));
    }



    #[test]
    fn test_matmul_8() {

        let mut arr1 =
            Array::from(vec![0.5271468808849665, 0.8043829147090844, 0.29507589390599864]);
        arr1.reshape(1, 3);

        let mut arr2 = Array::from(vec![0.18333855055950088,
                                        0.019732459506620614,
                                        0.7433212319725496,
                                        0.0382934041858366,
                                        0.4336796689738486,
                                        0.8320847613127487,
                                        0.013458558499757745,
                                        0.5093353915141386,
                                        0.47954870014125284,
                                        0.029654940797728235,
                                        0.011428526824066254,
                                        0.33184400023449434,
                                        0.06143107860529495,
                                        0.5981735080564744,
                                        0.8859202535226233,
                                        0.4121337753639407,
                                        0.03827219890219569,
                                        0.08084240379080565,
                                        0.08191454230184858,
                                        0.8093673338215349,
                                        0.8006940028849979,
                                        0.016909811354707704,
                                        0.8612943252306178,
                                        0.9113002243524484,
                                        0.40087668463516213,
                                        0.28689069833770775,
                                        0.8430448852638386]);
        arr2.reshape(3, 9);

        let mut result = Array::from(vec![0.1446712795814323,
                                          0.25841960572438155,
                                          0.8950346117137078,
                                          0.0745900363385533,
                                          0.9639206276486024,
                                          1.4201527306038018,
                                          0.45689705067645436,
                                          0.38393459513159073,
                                          0.5665830730273458]);
        result.reshape(1, 9);

        assert!(allclose(&arr1.dot(&arr2), &result));
    }



    #[test]
    fn test_matmul_9() {

        let mut arr1 = Array::from(vec![0.2287556137159159,
                                        0.841497971175196,
                                        0.8443584735081981,
                                        0.22014599338063867,
                                        0.811137639752162,
                                        0.5359535338891156,
                                        0.6104284489824332,
                                        0.5238698831262817]);
        arr1.reshape(1, 8);

        let mut arr2 = Array::from(vec![0.6396291484955626,
                                        0.005156348033917069,
                                        0.024738783415619525,
                                        0.6900263853157124,
                                        0.1715930195622134,
                                        0.6939306736886565,
                                        0.2852656231218128,
                                        0.05510592078168841]);
        arr2.reshape(8, 1);

        let mut result = Array::from(vec![1.037555498152202]);
        result.reshape(1, 1);

        assert!(allclose(&arr1.dot(&arr2), &result));
    }



    #[test]
    fn test_matmul_transpose_0() {

        let mut arr1 = Array::from(vec![0.32281613557530464,
                                        0.9669893878549964,
                                        0.19493466478308674,
                                        0.34739650514561404,
                                        0.1040140651107091,
                                        0.40178185247448894,
                                        0.09284764508729115,
                                        0.5048438064616992,
                                        0.7425907409447408,
                                        0.005290509169382895,
                                        0.09016116884502079,
                                        0.05618398091194032,
                                        0.8843256633664335,
                                        0.9855858566528506,
                                        0.5201746856274987,
                                        0.19841742953279573,
                                        0.9333483160830192,
                                        0.6545982033421369,
                                        0.791791747160087,
                                        0.511215678611379,
                                        0.7882118923792203,
                                        0.33479673167486723,
                                        0.11325313441738971,
                                        0.9048139767028247,
                                        0.004223913508407007,
                                        0.07350388060676039,
                                        0.13229136395536234,
                                        0.9421499192747]);
        arr1.reshape(4, 7);

        let mut arr2 = Array::from(vec![0.3029296862426224,
                                        0.2133130511803032,
                                        0.2556625525155257,
                                        0.09592006679437992,
                                        0.4017978829990967,
                                        0.7310276403556994,
                                        0.6482099352415909,
                                        0.250845580834519,
                                        0.22743891395182814,
                                        0.49581615834046866,
                                        0.8647649667829787,
                                        0.6340637531228465,
                                        0.7544924749082648,
                                        0.4371231912677318,
                                        0.4002120902427818,
                                        0.7229163139452544,
                                        0.3723685794123146,
                                        0.5525980303993004,
                                        0.08046361735719143,
                                        0.594275567103534,
                                        0.2809214669332072,
                                        0.7424475863144008,
                                        0.2988271966526831,
                                        0.7575366841711616,
                                        0.22636013801884003,
                                        0.0044076449230693315,
                                        0.13978028098719586,
                                        0.29576370224015924,
                                        0.19559381625075667,
                                        0.5488820378428916,
                                        0.2099921700900459,
                                        0.7784921702787021,
                                        0.4846799030422758,
                                        0.6393403927232835,
                                        0.16769630743472275,
                                        0.9246826037822882,
                                        0.7173399513633042,
                                        0.15481361149816686,
                                        0.7236336058193933,
                                        0.1864099258251244,
                                        0.8296645652434765,
                                        0.19664176333975436,
                                        0.9613006691117159,
                                        0.5475975848164579,
                                        0.22286359973606018,
                                        0.21272669051414417,
                                        0.6279879624064401,
                                        0.633276129149952,
                                        0.3032790372858618,
                                        0.8163677514534665,
                                        0.41905671700889435,
                                        0.8138582852339901,
                                        0.26521517056103106,
                                        0.9834254714034867,
                                        0.8723053226599075,
                                        0.44852458936494555]);
        arr2.reshape(8, 7);

        let mut result = Array::from(vec![0.7829128741212573,
                                          1.1076548927313479,
                                          1.3660268758147975,
                                          0.839024269644401,
                                          1.2281432597825857,
                                          1.6447200551382046,
                                          1.3051059519284065,
                                          1.413955077729016,
                                          1.6292449749399673,
                                          1.509786928716233,
                                          1.5975945860323733,
                                          1.0365024749344278,
                                          1.335535247553272,
                                          2.003547245521751,
                                          1.8065190606418229,
                                          2.0202579082637353,
                                          1.7040925166223766,
                                          2.4367546631322945,
                                          1.6498377159836357,
                                          1.6087877677536406,
                                          1.7590327330700064,
                                          1.9682442648248983,
                                          2.0159815694487846,
                                          3.019161374333937,
                                          1.0942637348537207,
                                          1.120269097250641,
                                          0.9043227105429124,
                                          1.2662674985779514,
                                          0.5991390445406645,
                                          0.8426811280976101,
                                          1.0020769397298828,
                                          1.668548794226767]);
        result.reshape(4, 8);

        assert!(allclose(&arr1.dot(&(arr2.T())), &result));
    }



    #[test]
    fn test_matmul_transpose_1() {

        let mut arr1 = Array::from(vec![0.6809495248305892,
                                        0.18915818640159343,
                                        0.0450455494971731,
                                        0.013139545362499061,
                                        0.6618106166295956,
                                        0.10751234469652782,
                                        0.309957639304688,
                                        0.30794744829381004,
                                        0.11747222616483843,
                                        0.9469314207950004,
                                        0.977390549235605,
                                        0.9044792542687089,
                                        0.7961801494650353,
                                        0.06542942286782805,
                                        0.7170386259969244,
                                        0.4559104342797371,
                                        0.15148371295050145,
                                        0.64672019512236,
                                        0.02923457187959755,
                                        0.7535208725100521]);
        arr1.reshape(4, 5);

        let mut arr2 = Array::from(vec![0.8897329460901544,
                                        0.010380039277155584,
                                        0.3274278428066417,
                                        0.828491091472489,
                                        0.11259759396041913,
                                        0.024695737913711602,
                                        0.8143535288722658,
                                        0.2489052719751651,
                                        0.24919659562913243,
                                        0.15823680006023388]);
        arr2.reshape(2, 5);

        let mut result = Array::from(vec![0.7079801427393371,
                                          0.2900673865515695,
                                          0.40365210885083935,
                                          0.5108330141717774,
                                          1.274641169891677,
                                          1.0886433771225437,
                                          0.7280303587324788,
                                          0.42211229429543284]);
        result.reshape(4, 2);

        assert!(allclose(&arr1.dot(&(arr2.T())), &result));
    }



    #[test]
    fn test_matmul_transpose_2() {

        let mut arr1 = Array::from(vec![0.366947042105522,
                                        0.349295593297441,
                                        0.33303578043732596,
                                        0.30336719777517984,
                                        0.31512728615391017,
                                        0.2702251773919264,
                                        0.9002946187524032,
                                        0.966974203293783,
                                        0.8966985473416658,
                                        0.3732753797966627,
                                        0.6482792162720238,
                                        0.3114418154612556,
                                        0.8099721019217031,
                                        0.8047728967088161,
                                        0.7944176886703367,
                                        0.11143517283136029,
                                        0.8115981436332995,
                                        0.7795523385965585,
                                        0.885080155097639,
                                        0.3224210518232872,
                                        0.10716543173998427,
                                        0.16124975726807989,
                                        0.672786361462869,
                                        0.7141498933545607]);
        arr1.reshape(6, 4);

        let mut arr2 = Array::from(vec![0.23723420298054942,
                                        0.8057173684799351,
                                        0.9182962973982041,
                                        0.9846218462188032,
                                        0.9970471450204329,
                                        0.5159239606629441,
                                        0.7000843086171844,
                                        0.07655877521919541,
                                        0.9011414967516501,
                                        0.8135826471117177,
                                        0.3590617132505789,
                                        0.9757037370929743,
                                        0.38598609699619557,
                                        0.01620939199104432,
                                        0.018674455363305253,
                                        0.5441395433621551,
                                        0.44314631723327513,
                                        0.02570014744707827,
                                        0.368304514558738,
                                        0.42032050791090325]);
        arr2.reshape(5, 4);

        let mut result = Array::from(vec![0.9730134097555654,
                                          0.802452011836729,
                                          1.0304289466491872,
                                          0.31859167606371497,
                                          0.4217582146760953,
                                          2.0713252296543336,
                                          1.1579249011624595,
                                          1.7705664615165373,
                                          0.6689963501607248,
                                          0.884613984006339,
                                          1.4154468412325385,
                                          1.5643261497920826,
                                          1.6483898319750427,
                                          0.5337378079584966,
                                          0.7766314353289808,
                                          1.6798049142966123,
                                          1.7874726907457785,
                                          1.778621426786623,
                                          0.40115445136891786,
                                          0.7190450457613462,
                                          1.9508663382245812,
                                          1.855706231371058,
                                          1.9979808431469654,
                                          0.5178721029830093,
                                          0.8411905356014459,
                                          1.4763298470230586,
                                          0.7157232170568675,
                                          1.1661317653115675,
                                          0.44513924299250907,
                                          0.5995962091075111]);
        result.reshape(6, 5);

        assert!(allclose(&arr1.dot(&(arr2.T())), &result));
    }



    #[test]
    fn test_matmul_transpose_3() {

        let mut arr1 = Array::from(vec![0.925358894742719,
                                        0.6992302184569288,
                                        0.8928740543794887,
                                        0.9754788397983389,
                                        0.5061117835654796,
                                        0.9366270650173475,
                                        0.4882657956734827,
                                        0.44295295987512373,
                                        0.0233104247827286,
                                        0.12842847576732785,
                                        0.7086610689956077,
                                        0.8830636980843853,
                                        0.04744236715872807,
                                        0.43802410113810686,
                                        0.11376075624879389,
                                        0.16104217757221106,
                                        0.6023318418322183,
                                        0.980939241992898,
                                        0.5664028494798152,
                                        0.11405886530309117,
                                        0.524170006233087,
                                        0.07916192339377204,
                                        0.7216642542468835,
                                        0.12006624986679015,
                                        0.7417686262268323,
                                        0.7713428993319802,
                                        0.06811643131249667,
                                        0.4768252782722475,
                                        0.44243096136594984,
                                        0.22410925267462767,
                                        0.6418249309983912,
                                        0.20606751054744699,
                                        0.5911059348014961,
                                        0.20539031038896527,
                                        0.23649362147998976,
                                        0.4699634060531236,
                                        0.09843193158940089,
                                        0.20091195344582968,
                                        0.5424174383692495,
                                        0.1113514802481127,
                                        0.23498480301506675,
                                        0.7936012015605645,
                                        0.38022526965283854,
                                        0.6593704828215721,
                                        0.7667270434875092,
                                        0.8152019193996527,
                                        0.22028493098698365,
                                        0.7519034635253526,
                                        0.8747074419589803,
                                        0.298494434904939,
                                        0.4727865952754454,
                                        0.22055303550683525,
                                        0.8992782384935715,
                                        0.9531837264977053]);
        arr1.reshape(9, 6);

        let mut arr2 = Array::from(vec![0.21325823493538731,
                                        0.0380136209209756,
                                        0.5668486704280946,
                                        0.15179717969563755,
                                        0.09452152183985785,
                                        0.7062092476664121,
                                        0.7768054491423071,
                                        0.6568681501402697,
                                        0.8338787454319962,
                                        0.9353569002817529,
                                        0.7045838818183099,
                                        0.39241111834607056,
                                        0.13806837340495992,
                                        0.12047223438561694,
                                        0.08497145948079843,
                                        0.46194116762750004,
                                        0.8737830712555522,
                                        0.6816395610502204,
                                        0.35460061572617096,
                                        0.7500113759420916,
                                        0.8195103581556754,
                                        0.30429266137660316,
                                        0.37504137257531567,
                                        0.9819895219734038,
                                        0.524157506354936,
                                        0.42741092643878753,
                                        0.5177706405135226,
                                        0.968976459901584,
                                        0.3986096682269529,
                                        0.2544486556082437,
                                        0.6432145486770265,
                                        0.46000586566151935,
                                        0.08480161648723994,
                                        0.07894648400880533,
                                        0.45490173613287155,
                                        0.4550962247572681,
                                        0.8312779808040611,
                                        0.1575017176252156,
                                        0.2603949552530008,
                                        0.936233645626559,
                                        0.6311176642674141,
                                        0.7134090490959616,
                                        0.5743026694270158,
                                        0.4522136434574674,
                                        0.5227429980971374,
                                        0.5577767757671542,
                                        0.84138917897813,
                                        0.671087704171892,
                                        0.8372540443335867,
                                        0.34298964015810507,
                                        0.07282651584859834,
                                        0.09673344668488926,
                                        0.991935404620845,
                                        0.25302526804618586]);
        arr2.reshape(9, 6);

        let mut result = Array::from(vec![1.5874132352880161,
                                          3.5592365313025978,
                                          1.8191572400745657,
                                          2.9906848622885462,
                                          2.6314769977797945,
                                          1.726068663858263,
                                          3.0127507543295313,
                                          2.9128765151070923,
                                          1.912996045913283,
                                          0.844284983952279,
                                          1.6556489310587907,
                                          1.40323191475713,
                                          1.6964786067084,
                                          1.0889382646093413,
                                          1.2541864672985314,
                                          1.679193585582082,
                                          1.7534144489795866,
                                          1.50123516770811,
                                          0.865380925847222,
                                          1.3793969313301555,
                                          1.3383328226781717,
                                          1.6767496403373547,
                                          0.9167255854761861,
                                          0.9747936326487815,
                                          1.3687763724898943,
                                          1.539711735869806,
                                          1.0594987009085777,
                                          0.5872721897901105,
                                          1.5816336672336893,
                                          0.8854708025913408,
                                          1.128601139333808,
                                          1.0119532354369312,
                                          0.8504143388267457,
                                          1.240519373356222,
                                          1.3828020047899279,
                                          1.3053992856711985,
                                          0.49858952001179513,
                                          1.9853558394803,
                                          0.9607437854699225,
                                          1.4284669677201003,
                                          1.449166691798682,
                                          1.1786125802308012,
                                          1.641368364824858,
                                          1.5990345260434795,
                                          1.4322652791558057,
                                          0.865199347657793,
                                          1.6700046672539322,
                                          0.7855362841727803,
                                          1.4792547262096951,
                                          1.1434187361240846,
                                          0.8954249094013815,
                                          1.3967366906671252,
                                          1.3997165817973811,
                                          1.024464851793592,
                                          0.9356598839335093,
                                          1.241883312145559,
                                          0.8815982003785465,
                                          1.5314275092717167,
                                          0.8218085607826606,
                                          0.6785821166080641,
                                          1.073427380572591,
                                          1.2233287139980678,
                                          0.6354879384855953,
                                          1.2163376331032387,
                                          2.580607147012728,
                                          1.2786665526487393,
                                          2.3267414790321057,
                                          1.9471488291912697,
                                          1.1196541581255886,
                                          2.0582366431483528,
                                          2.061981133727548,
                                          1.0879567375540788,
                                          1.2575115111815691,
                                          2.483748335383767,
                                          1.7342874570847941,
                                          2.261895178335525,
                                          1.6455672903994412,
                                          1.6003122450376708,
                                          2.3512991164916297,
                                          2.4038081755783036,
                                          2.023704589242493]);
        result.reshape(9, 9);

        assert!(allclose(&arr1.dot(&(arr2.T())), &result));
    }



    #[test]
    fn test_matmul_transpose_4() {

        let mut arr1 = Array::from(vec![0.0090899539715672,
                                        0.8072458651132488,
                                        0.35529167488218405,
                                        0.49492622902673444]);
        arr1.reshape(4, 1);

        let mut arr2 = Array::from(vec![0.886757945405175, 0.3642479026632883]);
        arr2.reshape(2, 1);

        let mut result = Array::from(vec![0.00806058890765454,
                                          0.0033109966694491806,
                                          0.7158316847846475,
                                          0.2940376133011126,
                                          0.315057715638089,
                                          0.12941424740956245,
                                          0.4388797659788781,
                                          0.18027584089603832]);
        result.reshape(4, 2);

        assert!(allclose(&arr1.dot(&(arr2.T())), &result));
    }



    #[test]
    fn test_matmul_transpose_5() {

        let mut arr1 = Array::from(vec![0.7329702869424403,
                                        0.9226694542304723,
                                        0.11350702559826464,
                                        0.0528956901318941,
                                        0.983282695928186,
                                        0.5861293956834694,
                                        0.002704026118440561,
                                        0.5149829462418875,
                                        0.687186035429361]);
        arr1.reshape(1, 9);

        let mut arr2 = Array::from(vec![0.6130971753715957,
                                        0.3106871258662929,
                                        0.8494692202657048,
                                        0.38324626496049474,
                                        0.6663324777094797,
                                        0.2638430979657117,
                                        0.705354491942043,
                                        0.7381416059458296,
                                        0.972902299988368,
                                        0.20574102904265834,
                                        0.6908971857920572,
                                        0.408033259260263,
                                        0.8074036228914386,
                                        0.7695767666103983,
                                        0.7367914897385391,
                                        0.0016274979892142438,
                                        0.0527367723268356,
                                        0.7393077117457478,
                                        0.8260329905282398,
                                        0.3658708614008537,
                                        0.7364171226011152,
                                        0.42969690597633725,
                                        0.00689279959220912,
                                        0.5011718489772471,
                                        0.007615569747099871,
                                        0.8728097962665927,
                                        0.15550074478902987]);
        arr2.reshape(3, 9);

        let mut result =
            Array::from(vec![2.713178234584766, 2.601066146892677, 1.9062429546218687]);
        result.reshape(1, 3);

        assert!(allclose(&arr1.dot(&(arr2.T())), &result));
    }



    #[test]
    fn test_matmul_transpose_6() {

        let mut arr1 = Array::from(vec![0.9276189989088249,
                                        0.8821012380772483,
                                        0.9576279927537044,
                                        0.22119528649355513,
                                        0.15085713741486573,
                                        0.12322318180711189,
                                        0.4779679546181437,
                                        0.25742220251992387,
                                        0.9464418322439493,
                                        0.4909424621118489,
                                        0.7208912195238542,
                                        0.9962322660739507,
                                        0.43533776323883855,
                                        0.021464328280912603,
                                        0.015101580588801289,
                                        0.4716963821413963]);
        arr1.reshape(2, 8);

        let mut arr2 = Array::from(vec![0.6380396395660042,
                                        0.10554754374241415,
                                        0.21965756983369356,
                                        0.7349374715928855,
                                        0.7131278653062647,
                                        0.9603874411608422,
                                        0.7313319921709864,
                                        0.8400464200610347,
                                        0.5942567718918943,
                                        0.6819923645474909,
                                        0.7108151819484294,
                                        0.1756086825292481,
                                        0.3818892264503654,
                                        0.39877587789472135,
                                        0.3871422778639042,
                                        0.18732006765193376,
                                        0.42338466389086193,
                                        0.7379784022664586,
                                        0.9901201285264503,
                                        0.06883631042351934,
                                        0.8524458513130413,
                                        0.7847495669454642,
                                        0.4793364790425151,
                                        0.2975398248045932,
                                        0.4832935210264835,
                                        0.3928910553212097,
                                        0.8996944797582809,
                                        0.2800125195754294,
                                        0.09461643872180725,
                                        0.5045095661759922,
                                        0.1777668022757236,
                                        0.23142416909963948]);
        arr2.reshape(4, 8);

        let mut result = Array::from(vec![1.849598533760568,
                                          2.2123816048166196,
                                          2.5381020520478583,
                                          1.9393734000168037,
                                          2.2845594999427936,
                                          1.8536308542383597,
                                          2.0808929411676527,
                                          1.7417010359535825]);
        result.reshape(2, 4);

        assert!(allclose(&arr1.dot(&(arr2.T())), &result));
    }



    #[test]
    fn test_matmul_transpose_7() {

        let mut arr1 = Array::from(vec![0.08296678138090297,
                                        0.9437328935177516,
                                        0.744747815929632,
                                        0.21508580305827518,
                                        0.16520095858396622,
                                        0.569792729771405,
                                        0.8190018101155101,
                                        0.4311572898376439,
                                        0.763872645481208,
                                        0.7301066611155371,
                                        0.4460436259912971,
                                        0.712182594310135,
                                        0.6392523938198028,
                                        0.22942030313207395,
                                        0.9593009800692543]);
        arr1.reshape(5, 3);

        let mut arr2 = Array::from(vec![0.595054503015288,
                                        0.4661395579234032,
                                        0.9263817177818151,
                                        0.20907644286927196,
                                        0.6835423168632275,
                                        0.9992868504856399,
                                        0.552504044859316,
                                        0.7112415725656607,
                                        0.1547054999725399,
                                        0.8769705245127782,
                                        0.9604000584486478,
                                        0.27916488757007085]);
        arr2.reshape(4, 3);

        let mut result = Array::from(vec![1.1792017516786777,
                                          1.4066444674489742,
                                          0.8322781327862652,
                                          1.1870279881811592,
                                          0.7328400452325623,
                                          0.727277602956498,
                                          0.32448363489412957,
                                          0.5063490431479596,
                                          1.395967837054699,
                                          1.2292761280655893,
                                          0.877334101217712,
                                          1.3455703545481614,
                                          1.3021247701037246,
                                          1.1692124987922305,
                                          0.8308102177524938,
                                          1.2674787198914046,
                                          1.3760107839727485,
                                          1.249087957175066,
                                          0.6647719281953499,
                                          1.048743929888444]);
        result.reshape(5, 4);

        assert!(allclose(&arr1.dot(&(arr2.T())), &result));
    }



    #[test]
    fn test_matmul_transpose_8() {

        let mut arr1 = Array::from(vec![0.7793405687788637,
                                        0.35782635935536344,
                                        0.36869416094740337,
                                        0.7011729025692875]);
        arr1.reshape(2, 2);

        let mut arr2 = Array::from(vec![0.5530864171670206,
                                        0.6227455940690618,
                                        0.20527674341921576,
                                        0.643186558812475,
                                        0.49611844132635763,
                                        0.6569378460971378,
                                        0.29300880113941585,
                                        0.14126333075681263]);
        arr2.reshape(4, 2);

        let mut result = Array::from(vec![0.6538774716691351,
                                          0.39012959869957675,
                                          0.6217149060366598,
                                          0.27890138909232814,
                                          0.6405720682644396,
                                          0.526669323013058,
                                          0.643542988810901,
                                          0.2070806537396611]);
        result.reshape(2, 4);

        assert!(allclose(&arr1.dot(&(arr2.T())), &result));
    }



    #[test]
    fn test_matmul_transpose_9() {

        let mut arr1 = Array::from(vec![0.3012425110859006,
                                        0.9640430207954833,
                                        0.8380881355116987,
                                        0.6100424254373409,
                                        0.8600049266328298,
                                        0.09426288492393198,
                                        0.8013578186849197]);
        arr1.reshape(7, 1);

        let mut arr2 = Array::from(vec![0.5875474663752694,
                                        0.2470255691434896,
                                        0.7333256607132345,
                                        0.9627502578511307]);
        arr2.reshape(4, 1);

        let mut result = Array::from(vec![0.17699427415304492,
                                          0.07441460275120858,
                                          0.2209088634769819,
                                          0.2900213052236729,
                                          0.5664210343451475,
                                          0.23814327589081324,
                                          0.7069574851808302,
                                          0.9281326668504345,
                                          0.4924165606190721,
                                          0.20702919866718342,
                                          0.6145915357100392,
                                          0.8068695685658612,
                                          0.35842888144713386,
                                          0.15069607734533397,
                                          0.44735976469694205,
                                          0.5873185023899291,
                                          0.5052937157133687,
                                          0.2124432064676798,
                                          0.6306636810396566,
                                          0.8279699648689995,
                                          0.05538391921027982,
                                          0.023285342797441565,
                                          0.069125392367578,
                                          0.09075161676630697,
                                          0.47083575602833716,
                                          0.19795587124822764,
                                          0.587656251854835,
                                          0.7715074465699261]);
        result.reshape(7, 4);

        assert!(allclose(&arr1.dot(&(arr2.T())), &result));
    }



    #[test]
    fn test_index_0() {

        let mut arr = Array::from(vec![0.215326974913587,
                                       0.6805099195535821,
                                       0.4748674293207318,
                                       0.9308159224933445,
                                       0.15796901892179882,
                                       0.48123372171929335,
                                       0.09109310508025259,
                                       0.17645768747481172,
                                       0.07362796696187168,
                                       0.34399329395805656,
                                       0.6769927850435898,
                                       0.27763892690350545,
                                       0.3104671690237111,
                                       0.05446100051600278,
                                       0.3025826095486641,
                                       0.8552415488703948]);
        arr.reshape(8, 2);

        assert!(close(arr.get(0, 0), 0.215326974914));
        assert!(close(arr.get(0, 1), 0.680509919554));
        assert!(close(arr.get(1, 0), 0.474867429321));
        assert!(close(arr.get(1, 1), 0.930815922493));
        assert!(close(arr.get(2, 0), 0.157969018922));
        assert!(close(arr.get(2, 1), 0.481233721719));
        assert!(close(arr.get(3, 0), 0.0910931050803));
        assert!(close(arr.get(3, 1), 0.176457687475));
        assert!(close(arr.get(4, 0), 0.0736279669619));
        assert!(close(arr.get(4, 1), 0.343993293958));
        assert!(close(arr.get(5, 0), 0.676992785044));
        assert!(close(arr.get(5, 1), 0.277638926904));
        assert!(close(arr.get(6, 0), 0.310467169024));
        assert!(close(arr.get(6, 1), 0.054461000516));
        assert!(close(arr.get(7, 0), 0.302582609549));
        assert!(close(arr.get(7, 1), 0.85524154887));
    }



    #[test]
    fn test_index_transpose_0() {

        let mut arr = Array::from(vec![0.215326974913587,
                                       0.6805099195535821,
                                       0.4748674293207318,
                                       0.9308159224933445,
                                       0.15796901892179882,
                                       0.48123372171929335,
                                       0.09109310508025259,
                                       0.17645768747481172,
                                       0.07362796696187168,
                                       0.34399329395805656,
                                       0.6769927850435898,
                                       0.27763892690350545,
                                       0.3104671690237111,
                                       0.05446100051600278,
                                       0.3025826095486641,
                                       0.8552415488703948]);
        arr.reshape(8, 2);

        let arr = arr.T();
        assert!(close(arr.get(0, 0), 0.215326974914));
        assert!(close(arr.get(1, 0), 0.680509919554));
        assert!(close(arr.get(0, 1), 0.474867429321));
        assert!(close(arr.get(1, 1), 0.930815922493));
        assert!(close(arr.get(0, 2), 0.157969018922));
        assert!(close(arr.get(1, 2), 0.481233721719));
        assert!(close(arr.get(0, 3), 0.0910931050803));
        assert!(close(arr.get(1, 3), 0.176457687475));
        assert!(close(arr.get(0, 4), 0.0736279669619));
        assert!(close(arr.get(1, 4), 0.343993293958));
        assert!(close(arr.get(0, 5), 0.676992785044));
        assert!(close(arr.get(1, 5), 0.277638926904));
        assert!(close(arr.get(0, 6), 0.310467169024));
        assert!(close(arr.get(1, 6), 0.054461000516));
        assert!(close(arr.get(0, 7), 0.302582609549));
        assert!(close(arr.get(1, 7), 0.85524154887));
    }



    #[test]
    fn test_index_mut_0() {

        let mut arr = Array::from(vec![0.215326974913587,
                                       0.6805099195535821,
                                       0.4748674293207318,
                                       0.9308159224933445,
                                       0.15796901892179882,
                                       0.48123372171929335,
                                       0.09109310508025259,
                                       0.17645768747481172,
                                       0.07362796696187168,
                                       0.34399329395805656,
                                       0.6769927850435898,
                                       0.27763892690350545,
                                       0.3104671690237111,
                                       0.05446100051600278,
                                       0.3025826095486641,
                                       0.8552415488703948]);
        arr.reshape(8, 2);

        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.21532697491));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.68050991955));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.47486742932));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.93081592249));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.15796901892));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.48123372172));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.09109310508));
        let mut v = arr.get(3, 1);
        v += 1.0;
        assert!(close(v, 1.17645768747));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.07362796696));
        let mut v = arr.get(4, 1);
        v += 1.0;
        assert!(close(v, 1.34399329396));
        let mut v = arr.get(5, 0);
        v += 1.0;
        assert!(close(v, 1.67699278504));
        let mut v = arr.get(5, 1);
        v += 1.0;
        assert!(close(v, 1.2776389269));
        let mut v = arr.get(6, 0);
        v += 1.0;
        assert!(close(v, 1.31046716902));
        let mut v = arr.get(6, 1);
        v += 1.0;
        assert!(close(v, 1.05446100052));
        let mut v = arr.get(7, 0);
        v += 1.0;
        assert!(close(v, 1.30258260955));
        let mut v = arr.get(7, 1);
        v += 1.0;
        assert!(close(v, 1.85524154887));
    }



    #[test]
    fn test_index_transpose_mut_0() {

        let mut arr = Array::from(vec![0.215326974913587,
                                       0.6805099195535821,
                                       0.4748674293207318,
                                       0.9308159224933445,
                                       0.15796901892179882,
                                       0.48123372171929335,
                                       0.09109310508025259,
                                       0.17645768747481172,
                                       0.07362796696187168,
                                       0.34399329395805656,
                                       0.6769927850435898,
                                       0.27763892690350545,
                                       0.3104671690237111,
                                       0.05446100051600278,
                                       0.3025826095486641,
                                       0.8552415488703948]);
        arr.reshape(8, 2);

        let arr = arr.T();
        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.21532697491));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.68050991955));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.47486742932));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.93081592249));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.15796901892));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.48123372172));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.09109310508));
        let mut v = arr.get(1, 3);
        v += 1.0;
        assert!(close(v, 1.17645768747));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.07362796696));
        let mut v = arr.get(1, 4);
        v += 1.0;
        assert!(close(v, 1.34399329396));
        let mut v = arr.get(0, 5);
        v += 1.0;
        assert!(close(v, 1.67699278504));
        let mut v = arr.get(1, 5);
        v += 1.0;
        assert!(close(v, 1.2776389269));
        let mut v = arr.get(0, 6);
        v += 1.0;
        assert!(close(v, 1.31046716902));
        let mut v = arr.get(1, 6);
        v += 1.0;
        assert!(close(v, 1.05446100052));
        let mut v = arr.get(0, 7);
        v += 1.0;
        assert!(close(v, 1.30258260955));
        let mut v = arr.get(1, 7);
        v += 1.0;
        assert!(close(v, 1.85524154887));
    }



    #[test]
    fn test_index_unsafe_0() {

        let mut arr = Array::from(vec![0.215326974913587,
                                       0.6805099195535821,
                                       0.4748674293207318,
                                       0.9308159224933445,
                                       0.15796901892179882,
                                       0.48123372171929335,
                                       0.09109310508025259,
                                       0.17645768747481172,
                                       0.07362796696187168,
                                       0.34399329395805656,
                                       0.6769927850435898,
                                       0.27763892690350545,
                                       0.3104671690237111,
                                       0.05446100051600278,
                                       0.3025826095486641,
                                       0.8552415488703948]);
        arr.reshape(8, 2);

        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.215326974914));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.680509919554));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.474867429321));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.930815922493));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.157969018922));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.481233721719));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.0910931050803));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 1), 0.176457687475));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.0736279669619));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 1), 0.343993293958));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 0), 0.676992785044));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 1), 0.277638926904));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 0), 0.310467169024));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 1), 0.054461000516));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 0), 0.302582609549));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 1), 0.85524154887));
        };
    }



    #[test]
    fn test_index_transpose_unsafe_0() {

        let mut arr = Array::from(vec![0.215326974913587,
                                       0.6805099195535821,
                                       0.4748674293207318,
                                       0.9308159224933445,
                                       0.15796901892179882,
                                       0.48123372171929335,
                                       0.09109310508025259,
                                       0.17645768747481172,
                                       0.07362796696187168,
                                       0.34399329395805656,
                                       0.6769927850435898,
                                       0.27763892690350545,
                                       0.3104671690237111,
                                       0.05446100051600278,
                                       0.3025826095486641,
                                       0.8552415488703948]);
        arr.reshape(8, 2);

        let arr = arr.T();
        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.215326974914));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.680509919554));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.474867429321));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.930815922493));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.157969018922));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.481233721719));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.0910931050803));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 3), 0.176457687475));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.0736279669619));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 4), 0.343993293958));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 5), 0.676992785044));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 5), 0.277638926904));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 6), 0.310467169024));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 6), 0.054461000516));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 7), 0.302582609549));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 7), 0.85524154887));
        };
    }



    #[test]
    fn test_index_1() {

        let mut arr = Array::from(vec![0.9570919550354068,
                                       0.4584494243018158,
                                       0.7325601962236107,
                                       0.7243072717708018,
                                       0.3613850934270306,
                                       0.5761485027298561,
                                       0.09116891942241268,
                                       0.79391017855673,
                                       0.4270675742297524,
                                       0.6014689371746276,
                                       0.0566050497078342,
                                       0.08454409755727632,
                                       0.018154562228838156,
                                       0.6510911907876277,
                                       0.43693418658497074,
                                       0.1121532057198672,
                                       0.05423778016957859,
                                       0.6384092286500843,
                                       0.951293670338954,
                                       0.9984309373462644]);
        arr.reshape(4, 5);

        assert!(close(arr.get(0, 0), 0.957091955035));
        assert!(close(arr.get(0, 1), 0.458449424302));
        assert!(close(arr.get(0, 2), 0.732560196224));
        assert!(close(arr.get(0, 3), 0.724307271771));
        assert!(close(arr.get(0, 4), 0.361385093427));
        assert!(close(arr.get(1, 0), 0.57614850273));
        assert!(close(arr.get(1, 1), 0.0911689194224));
        assert!(close(arr.get(1, 2), 0.793910178557));
        assert!(close(arr.get(1, 3), 0.42706757423));
        assert!(close(arr.get(1, 4), 0.601468937175));
        assert!(close(arr.get(2, 0), 0.0566050497078));
        assert!(close(arr.get(2, 1), 0.0845440975573));
        assert!(close(arr.get(2, 2), 0.0181545622288));
        assert!(close(arr.get(2, 3), 0.651091190788));
        assert!(close(arr.get(2, 4), 0.436934186585));
        assert!(close(arr.get(3, 0), 0.11215320572));
        assert!(close(arr.get(3, 1), 0.0542377801696));
        assert!(close(arr.get(3, 2), 0.63840922865));
        assert!(close(arr.get(3, 3), 0.951293670339));
        assert!(close(arr.get(3, 4), 0.998430937346));
    }



    #[test]
    fn test_index_transpose_1() {

        let mut arr = Array::from(vec![0.9570919550354068,
                                       0.4584494243018158,
                                       0.7325601962236107,
                                       0.7243072717708018,
                                       0.3613850934270306,
                                       0.5761485027298561,
                                       0.09116891942241268,
                                       0.79391017855673,
                                       0.4270675742297524,
                                       0.6014689371746276,
                                       0.0566050497078342,
                                       0.08454409755727632,
                                       0.018154562228838156,
                                       0.6510911907876277,
                                       0.43693418658497074,
                                       0.1121532057198672,
                                       0.05423778016957859,
                                       0.6384092286500843,
                                       0.951293670338954,
                                       0.9984309373462644]);
        arr.reshape(4, 5);

        let arr = arr.T();
        assert!(close(arr.get(0, 0), 0.957091955035));
        assert!(close(arr.get(1, 0), 0.458449424302));
        assert!(close(arr.get(2, 0), 0.732560196224));
        assert!(close(arr.get(3, 0), 0.724307271771));
        assert!(close(arr.get(4, 0), 0.361385093427));
        assert!(close(arr.get(0, 1), 0.57614850273));
        assert!(close(arr.get(1, 1), 0.0911689194224));
        assert!(close(arr.get(2, 1), 0.793910178557));
        assert!(close(arr.get(3, 1), 0.42706757423));
        assert!(close(arr.get(4, 1), 0.601468937175));
        assert!(close(arr.get(0, 2), 0.0566050497078));
        assert!(close(arr.get(1, 2), 0.0845440975573));
        assert!(close(arr.get(2, 2), 0.0181545622288));
        assert!(close(arr.get(3, 2), 0.651091190788));
        assert!(close(arr.get(4, 2), 0.436934186585));
        assert!(close(arr.get(0, 3), 0.11215320572));
        assert!(close(arr.get(1, 3), 0.0542377801696));
        assert!(close(arr.get(2, 3), 0.63840922865));
        assert!(close(arr.get(3, 3), 0.951293670339));
        assert!(close(arr.get(4, 3), 0.998430937346));
    }



    #[test]
    fn test_index_mut_1() {

        let mut arr = Array::from(vec![0.9570919550354068,
                                       0.4584494243018158,
                                       0.7325601962236107,
                                       0.7243072717708018,
                                       0.3613850934270306,
                                       0.5761485027298561,
                                       0.09116891942241268,
                                       0.79391017855673,
                                       0.4270675742297524,
                                       0.6014689371746276,
                                       0.0566050497078342,
                                       0.08454409755727632,
                                       0.018154562228838156,
                                       0.6510911907876277,
                                       0.43693418658497074,
                                       0.1121532057198672,
                                       0.05423778016957859,
                                       0.6384092286500843,
                                       0.951293670338954,
                                       0.9984309373462644]);
        arr.reshape(4, 5);

        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.95709195504));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.4584494243));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.73256019622));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.72430727177));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.36138509343));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.57614850273));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.09116891942));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.79391017856));
        let mut v = arr.get(1, 3);
        v += 1.0;
        assert!(close(v, 1.42706757423));
        let mut v = arr.get(1, 4);
        v += 1.0;
        assert!(close(v, 1.60146893717));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.05660504971));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.08454409756));
        let mut v = arr.get(2, 2);
        v += 1.0;
        assert!(close(v, 1.01815456223));
        let mut v = arr.get(2, 3);
        v += 1.0;
        assert!(close(v, 1.65109119079));
        let mut v = arr.get(2, 4);
        v += 1.0;
        assert!(close(v, 1.43693418658));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.11215320572));
        let mut v = arr.get(3, 1);
        v += 1.0;
        assert!(close(v, 1.05423778017));
        let mut v = arr.get(3, 2);
        v += 1.0;
        assert!(close(v, 1.63840922865));
        let mut v = arr.get(3, 3);
        v += 1.0;
        assert!(close(v, 1.95129367034));
        let mut v = arr.get(3, 4);
        v += 1.0;
        assert!(close(v, 1.99843093735));
    }



    #[test]
    fn test_index_transpose_mut_1() {

        let mut arr = Array::from(vec![0.9570919550354068,
                                       0.4584494243018158,
                                       0.7325601962236107,
                                       0.7243072717708018,
                                       0.3613850934270306,
                                       0.5761485027298561,
                                       0.09116891942241268,
                                       0.79391017855673,
                                       0.4270675742297524,
                                       0.6014689371746276,
                                       0.0566050497078342,
                                       0.08454409755727632,
                                       0.018154562228838156,
                                       0.6510911907876277,
                                       0.43693418658497074,
                                       0.1121532057198672,
                                       0.05423778016957859,
                                       0.6384092286500843,
                                       0.951293670338954,
                                       0.9984309373462644]);
        arr.reshape(4, 5);

        let arr = arr.T();
        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.95709195504));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.4584494243));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.73256019622));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.72430727177));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.36138509343));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.57614850273));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.09116891942));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.79391017856));
        let mut v = arr.get(3, 1);
        v += 1.0;
        assert!(close(v, 1.42706757423));
        let mut v = arr.get(4, 1);
        v += 1.0;
        assert!(close(v, 1.60146893717));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.05660504971));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.08454409756));
        let mut v = arr.get(2, 2);
        v += 1.0;
        assert!(close(v, 1.01815456223));
        let mut v = arr.get(3, 2);
        v += 1.0;
        assert!(close(v, 1.65109119079));
        let mut v = arr.get(4, 2);
        v += 1.0;
        assert!(close(v, 1.43693418658));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.11215320572));
        let mut v = arr.get(1, 3);
        v += 1.0;
        assert!(close(v, 1.05423778017));
        let mut v = arr.get(2, 3);
        v += 1.0;
        assert!(close(v, 1.63840922865));
        let mut v = arr.get(3, 3);
        v += 1.0;
        assert!(close(v, 1.95129367034));
        let mut v = arr.get(4, 3);
        v += 1.0;
        assert!(close(v, 1.99843093735));
    }



    #[test]
    fn test_index_unsafe_1() {

        let mut arr = Array::from(vec![0.9570919550354068,
                                       0.4584494243018158,
                                       0.7325601962236107,
                                       0.7243072717708018,
                                       0.3613850934270306,
                                       0.5761485027298561,
                                       0.09116891942241268,
                                       0.79391017855673,
                                       0.4270675742297524,
                                       0.6014689371746276,
                                       0.0566050497078342,
                                       0.08454409755727632,
                                       0.018154562228838156,
                                       0.6510911907876277,
                                       0.43693418658497074,
                                       0.1121532057198672,
                                       0.05423778016957859,
                                       0.6384092286500843,
                                       0.951293670338954,
                                       0.9984309373462644]);
        arr.reshape(4, 5);

        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.957091955035));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.458449424302));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.732560196224));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.724307271771));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.361385093427));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.57614850273));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.0911689194224));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.793910178557));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 3), 0.42706757423));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 4), 0.601468937175));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.0566050497078));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.0845440975573));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 2), 0.0181545622288));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 3), 0.651091190788));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 4), 0.436934186585));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.11215320572));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 1), 0.0542377801696));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 2), 0.63840922865));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 3), 0.951293670339));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 4), 0.998430937346));
        };
    }



    #[test]
    fn test_index_transpose_unsafe_1() {

        let mut arr = Array::from(vec![0.9570919550354068,
                                       0.4584494243018158,
                                       0.7325601962236107,
                                       0.7243072717708018,
                                       0.3613850934270306,
                                       0.5761485027298561,
                                       0.09116891942241268,
                                       0.79391017855673,
                                       0.4270675742297524,
                                       0.6014689371746276,
                                       0.0566050497078342,
                                       0.08454409755727632,
                                       0.018154562228838156,
                                       0.6510911907876277,
                                       0.43693418658497074,
                                       0.1121532057198672,
                                       0.05423778016957859,
                                       0.6384092286500843,
                                       0.951293670338954,
                                       0.9984309373462644]);
        arr.reshape(4, 5);

        let arr = arr.T();
        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.957091955035));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.458449424302));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.732560196224));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.724307271771));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.361385093427));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.57614850273));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.0911689194224));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.793910178557));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 1), 0.42706757423));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 1), 0.601468937175));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.0566050497078));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.0845440975573));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 2), 0.0181545622288));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 2), 0.651091190788));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 2), 0.436934186585));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.11215320572));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 3), 0.0542377801696));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 3), 0.63840922865));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 3), 0.951293670339));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 3), 0.998430937346));
        };
    }



    #[test]
    fn test_index_2() {

        let mut arr = Array::from(vec![0.8601557407225077,
                                       0.40321033442362164,
                                       0.14247985606097524,
                                       0.26937234786738784,
                                       0.5798684722291974,
                                       0.5632966236167654,
                                       0.8942163566518069,
                                       0.4935655841140425,
                                       0.7686310384422732,
                                       0.3707877682545938,
                                       0.33448589916704596,
                                       0.38941280660658095,
                                       0.4880493616861097,
                                       0.7933563093096604,
                                       0.1663297283689782,
                                       0.2144586116668381]);
        arr.reshape(2, 8);

        assert!(close(arr.get(0, 0), 0.860155740723));
        assert!(close(arr.get(0, 1), 0.403210334424));
        assert!(close(arr.get(0, 2), 0.142479856061));
        assert!(close(arr.get(0, 3), 0.269372347867));
        assert!(close(arr.get(0, 4), 0.579868472229));
        assert!(close(arr.get(0, 5), 0.563296623617));
        assert!(close(arr.get(0, 6), 0.894216356652));
        assert!(close(arr.get(0, 7), 0.493565584114));
        assert!(close(arr.get(1, 0), 0.768631038442));
        assert!(close(arr.get(1, 1), 0.370787768255));
        assert!(close(arr.get(1, 2), 0.334485899167));
        assert!(close(arr.get(1, 3), 0.389412806607));
        assert!(close(arr.get(1, 4), 0.488049361686));
        assert!(close(arr.get(1, 5), 0.79335630931));
        assert!(close(arr.get(1, 6), 0.166329728369));
        assert!(close(arr.get(1, 7), 0.214458611667));
    }



    #[test]
    fn test_index_transpose_2() {

        let mut arr = Array::from(vec![0.8601557407225077,
                                       0.40321033442362164,
                                       0.14247985606097524,
                                       0.26937234786738784,
                                       0.5798684722291974,
                                       0.5632966236167654,
                                       0.8942163566518069,
                                       0.4935655841140425,
                                       0.7686310384422732,
                                       0.3707877682545938,
                                       0.33448589916704596,
                                       0.38941280660658095,
                                       0.4880493616861097,
                                       0.7933563093096604,
                                       0.1663297283689782,
                                       0.2144586116668381]);
        arr.reshape(2, 8);

        let arr = arr.T();
        assert!(close(arr.get(0, 0), 0.860155740723));
        assert!(close(arr.get(1, 0), 0.403210334424));
        assert!(close(arr.get(2, 0), 0.142479856061));
        assert!(close(arr.get(3, 0), 0.269372347867));
        assert!(close(arr.get(4, 0), 0.579868472229));
        assert!(close(arr.get(5, 0), 0.563296623617));
        assert!(close(arr.get(6, 0), 0.894216356652));
        assert!(close(arr.get(7, 0), 0.493565584114));
        assert!(close(arr.get(0, 1), 0.768631038442));
        assert!(close(arr.get(1, 1), 0.370787768255));
        assert!(close(arr.get(2, 1), 0.334485899167));
        assert!(close(arr.get(3, 1), 0.389412806607));
        assert!(close(arr.get(4, 1), 0.488049361686));
        assert!(close(arr.get(5, 1), 0.79335630931));
        assert!(close(arr.get(6, 1), 0.166329728369));
        assert!(close(arr.get(7, 1), 0.214458611667));
    }



    #[test]
    fn test_index_mut_2() {

        let mut arr = Array::from(vec![0.8601557407225077,
                                       0.40321033442362164,
                                       0.14247985606097524,
                                       0.26937234786738784,
                                       0.5798684722291974,
                                       0.5632966236167654,
                                       0.8942163566518069,
                                       0.4935655841140425,
                                       0.7686310384422732,
                                       0.3707877682545938,
                                       0.33448589916704596,
                                       0.38941280660658095,
                                       0.4880493616861097,
                                       0.7933563093096604,
                                       0.1663297283689782,
                                       0.2144586116668381]);
        arr.reshape(2, 8);

        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.86015574072));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.40321033442));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.14247985606));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.26937234787));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.57986847223));
        let mut v = arr.get(0, 5);
        v += 1.0;
        assert!(close(v, 1.56329662362));
        let mut v = arr.get(0, 6);
        v += 1.0;
        assert!(close(v, 1.89421635665));
        let mut v = arr.get(0, 7);
        v += 1.0;
        assert!(close(v, 1.49356558411));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.76863103844));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.37078776825));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.33448589917));
        let mut v = arr.get(1, 3);
        v += 1.0;
        assert!(close(v, 1.38941280661));
        let mut v = arr.get(1, 4);
        v += 1.0;
        assert!(close(v, 1.48804936169));
        let mut v = arr.get(1, 5);
        v += 1.0;
        assert!(close(v, 1.79335630931));
        let mut v = arr.get(1, 6);
        v += 1.0;
        assert!(close(v, 1.16632972837));
        let mut v = arr.get(1, 7);
        v += 1.0;
        assert!(close(v, 1.21445861167));
    }



    #[test]
    fn test_index_transpose_mut_2() {

        let mut arr = Array::from(vec![0.8601557407225077,
                                       0.40321033442362164,
                                       0.14247985606097524,
                                       0.26937234786738784,
                                       0.5798684722291974,
                                       0.5632966236167654,
                                       0.8942163566518069,
                                       0.4935655841140425,
                                       0.7686310384422732,
                                       0.3707877682545938,
                                       0.33448589916704596,
                                       0.38941280660658095,
                                       0.4880493616861097,
                                       0.7933563093096604,
                                       0.1663297283689782,
                                       0.2144586116668381]);
        arr.reshape(2, 8);

        let arr = arr.T();
        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.86015574072));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.40321033442));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.14247985606));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.26937234787));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.57986847223));
        let mut v = arr.get(5, 0);
        v += 1.0;
        assert!(close(v, 1.56329662362));
        let mut v = arr.get(6, 0);
        v += 1.0;
        assert!(close(v, 1.89421635665));
        let mut v = arr.get(7, 0);
        v += 1.0;
        assert!(close(v, 1.49356558411));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.76863103844));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.37078776825));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.33448589917));
        let mut v = arr.get(3, 1);
        v += 1.0;
        assert!(close(v, 1.38941280661));
        let mut v = arr.get(4, 1);
        v += 1.0;
        assert!(close(v, 1.48804936169));
        let mut v = arr.get(5, 1);
        v += 1.0;
        assert!(close(v, 1.79335630931));
        let mut v = arr.get(6, 1);
        v += 1.0;
        assert!(close(v, 1.16632972837));
        let mut v = arr.get(7, 1);
        v += 1.0;
        assert!(close(v, 1.21445861167));
    }



    #[test]
    fn test_index_unsafe_2() {

        let mut arr = Array::from(vec![0.8601557407225077,
                                       0.40321033442362164,
                                       0.14247985606097524,
                                       0.26937234786738784,
                                       0.5798684722291974,
                                       0.5632966236167654,
                                       0.8942163566518069,
                                       0.4935655841140425,
                                       0.7686310384422732,
                                       0.3707877682545938,
                                       0.33448589916704596,
                                       0.38941280660658095,
                                       0.4880493616861097,
                                       0.7933563093096604,
                                       0.1663297283689782,
                                       0.2144586116668381]);
        arr.reshape(2, 8);

        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.860155740723));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.403210334424));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.142479856061));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.269372347867));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.579868472229));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 5), 0.563296623617));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 6), 0.894216356652));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 7), 0.493565584114));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.768631038442));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.370787768255));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.334485899167));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 3), 0.389412806607));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 4), 0.488049361686));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 5), 0.79335630931));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 6), 0.166329728369));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 7), 0.214458611667));
        };
    }



    #[test]
    fn test_index_transpose_unsafe_2() {

        let mut arr = Array::from(vec![0.8601557407225077,
                                       0.40321033442362164,
                                       0.14247985606097524,
                                       0.26937234786738784,
                                       0.5798684722291974,
                                       0.5632966236167654,
                                       0.8942163566518069,
                                       0.4935655841140425,
                                       0.7686310384422732,
                                       0.3707877682545938,
                                       0.33448589916704596,
                                       0.38941280660658095,
                                       0.4880493616861097,
                                       0.7933563093096604,
                                       0.1663297283689782,
                                       0.2144586116668381]);
        arr.reshape(2, 8);

        let arr = arr.T();
        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.860155740723));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.403210334424));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.142479856061));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.269372347867));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.579868472229));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 0), 0.563296623617));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 0), 0.894216356652));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 0), 0.493565584114));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.768631038442));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.370787768255));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.334485899167));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 1), 0.389412806607));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 1), 0.488049361686));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 1), 0.79335630931));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 1), 0.166329728369));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 1), 0.214458611667));
        };
    }



    #[test]
    fn test_index_3() {

        let mut arr = Array::from(vec![0.3647979523539372,
                                       0.36308406394227044,
                                       0.21404950758183616,
                                       0.36811953573544476,
                                       0.15420979571680848,
                                       0.7091867671879617,
                                       0.8245692241181685,
                                       0.28601877391422614,
                                       0.7053682579186311,
                                       0.9436051798229766,
                                       0.13564080650832278,
                                       0.49162020823877484,
                                       0.6575486409921484,
                                       0.5224264019283387,
                                       0.1304045608362886,
                                       0.40313708114722413,
                                       0.4123952289574855,
                                       0.4308186558945438,
                                       0.11908643991366652,
                                       0.2579691080534129,
                                       0.47102938170577524,
                                       0.878796734322898,
                                       0.7789561501543262,
                                       0.7959634630696436,
                                       0.004418088734142178,
                                       0.8552923824803051,
                                       0.19673926667104624,
                                       0.9213117917011139,
                                       0.11573887674353178,
                                       0.09984725008755602,
                                       0.4149531641983125,
                                       0.8301283257987035,
                                       0.6583325997105612,
                                       0.8405620427928018,
                                       0.29872918139103655,
                                       0.2913539353436094,
                                       0.21961401853166496,
                                       0.8731108344033446,
                                       0.9925319133165988,
                                       0.12493108260697727,
                                       0.5167221149865642,
                                       0.35603600906937594]);
        arr.reshape(7, 6);

        assert!(close(arr.get(0, 0), 0.364797952354));
        assert!(close(arr.get(0, 1), 0.363084063942));
        assert!(close(arr.get(0, 2), 0.214049507582));
        assert!(close(arr.get(0, 3), 0.368119535735));
        assert!(close(arr.get(0, 4), 0.154209795717));
        assert!(close(arr.get(0, 5), 0.709186767188));
        assert!(close(arr.get(1, 0), 0.824569224118));
        assert!(close(arr.get(1, 1), 0.286018773914));
        assert!(close(arr.get(1, 2), 0.705368257919));
        assert!(close(arr.get(1, 3), 0.943605179823));
        assert!(close(arr.get(1, 4), 0.135640806508));
        assert!(close(arr.get(1, 5), 0.491620208239));
        assert!(close(arr.get(2, 0), 0.657548640992));
        assert!(close(arr.get(2, 1), 0.522426401928));
        assert!(close(arr.get(2, 2), 0.130404560836));
        assert!(close(arr.get(2, 3), 0.403137081147));
        assert!(close(arr.get(2, 4), 0.412395228957));
        assert!(close(arr.get(2, 5), 0.430818655895));
        assert!(close(arr.get(3, 0), 0.119086439914));
        assert!(close(arr.get(3, 1), 0.257969108053));
        assert!(close(arr.get(3, 2), 0.471029381706));
        assert!(close(arr.get(3, 3), 0.878796734323));
        assert!(close(arr.get(3, 4), 0.778956150154));
        assert!(close(arr.get(3, 5), 0.79596346307));
        assert!(close(arr.get(4, 0), 0.00441808873414));
        assert!(close(arr.get(4, 1), 0.85529238248));
        assert!(close(arr.get(4, 2), 0.196739266671));
        assert!(close(arr.get(4, 3), 0.921311791701));
        assert!(close(arr.get(4, 4), 0.115738876744));
        assert!(close(arr.get(4, 5), 0.0998472500876));
        assert!(close(arr.get(5, 0), 0.414953164198));
        assert!(close(arr.get(5, 1), 0.830128325799));
        assert!(close(arr.get(5, 2), 0.658332599711));
        assert!(close(arr.get(5, 3), 0.840562042793));
        assert!(close(arr.get(5, 4), 0.298729181391));
        assert!(close(arr.get(5, 5), 0.291353935344));
        assert!(close(arr.get(6, 0), 0.219614018532));
        assert!(close(arr.get(6, 1), 0.873110834403));
        assert!(close(arr.get(6, 2), 0.992531913317));
        assert!(close(arr.get(6, 3), 0.124931082607));
        assert!(close(arr.get(6, 4), 0.516722114987));
        assert!(close(arr.get(6, 5), 0.356036009069));
    }



    #[test]
    fn test_index_transpose_3() {

        let mut arr = Array::from(vec![0.3647979523539372,
                                       0.36308406394227044,
                                       0.21404950758183616,
                                       0.36811953573544476,
                                       0.15420979571680848,
                                       0.7091867671879617,
                                       0.8245692241181685,
                                       0.28601877391422614,
                                       0.7053682579186311,
                                       0.9436051798229766,
                                       0.13564080650832278,
                                       0.49162020823877484,
                                       0.6575486409921484,
                                       0.5224264019283387,
                                       0.1304045608362886,
                                       0.40313708114722413,
                                       0.4123952289574855,
                                       0.4308186558945438,
                                       0.11908643991366652,
                                       0.2579691080534129,
                                       0.47102938170577524,
                                       0.878796734322898,
                                       0.7789561501543262,
                                       0.7959634630696436,
                                       0.004418088734142178,
                                       0.8552923824803051,
                                       0.19673926667104624,
                                       0.9213117917011139,
                                       0.11573887674353178,
                                       0.09984725008755602,
                                       0.4149531641983125,
                                       0.8301283257987035,
                                       0.6583325997105612,
                                       0.8405620427928018,
                                       0.29872918139103655,
                                       0.2913539353436094,
                                       0.21961401853166496,
                                       0.8731108344033446,
                                       0.9925319133165988,
                                       0.12493108260697727,
                                       0.5167221149865642,
                                       0.35603600906937594]);
        arr.reshape(7, 6);

        let arr = arr.T();
        assert!(close(arr.get(0, 0), 0.364797952354));
        assert!(close(arr.get(1, 0), 0.363084063942));
        assert!(close(arr.get(2, 0), 0.214049507582));
        assert!(close(arr.get(3, 0), 0.368119535735));
        assert!(close(arr.get(4, 0), 0.154209795717));
        assert!(close(arr.get(5, 0), 0.709186767188));
        assert!(close(arr.get(0, 1), 0.824569224118));
        assert!(close(arr.get(1, 1), 0.286018773914));
        assert!(close(arr.get(2, 1), 0.705368257919));
        assert!(close(arr.get(3, 1), 0.943605179823));
        assert!(close(arr.get(4, 1), 0.135640806508));
        assert!(close(arr.get(5, 1), 0.491620208239));
        assert!(close(arr.get(0, 2), 0.657548640992));
        assert!(close(arr.get(1, 2), 0.522426401928));
        assert!(close(arr.get(2, 2), 0.130404560836));
        assert!(close(arr.get(3, 2), 0.403137081147));
        assert!(close(arr.get(4, 2), 0.412395228957));
        assert!(close(arr.get(5, 2), 0.430818655895));
        assert!(close(arr.get(0, 3), 0.119086439914));
        assert!(close(arr.get(1, 3), 0.257969108053));
        assert!(close(arr.get(2, 3), 0.471029381706));
        assert!(close(arr.get(3, 3), 0.878796734323));
        assert!(close(arr.get(4, 3), 0.778956150154));
        assert!(close(arr.get(5, 3), 0.79596346307));
        assert!(close(arr.get(0, 4), 0.00441808873414));
        assert!(close(arr.get(1, 4), 0.85529238248));
        assert!(close(arr.get(2, 4), 0.196739266671));
        assert!(close(arr.get(3, 4), 0.921311791701));
        assert!(close(arr.get(4, 4), 0.115738876744));
        assert!(close(arr.get(5, 4), 0.0998472500876));
        assert!(close(arr.get(0, 5), 0.414953164198));
        assert!(close(arr.get(1, 5), 0.830128325799));
        assert!(close(arr.get(2, 5), 0.658332599711));
        assert!(close(arr.get(3, 5), 0.840562042793));
        assert!(close(arr.get(4, 5), 0.298729181391));
        assert!(close(arr.get(5, 5), 0.291353935344));
        assert!(close(arr.get(0, 6), 0.219614018532));
        assert!(close(arr.get(1, 6), 0.873110834403));
        assert!(close(arr.get(2, 6), 0.992531913317));
        assert!(close(arr.get(3, 6), 0.124931082607));
        assert!(close(arr.get(4, 6), 0.516722114987));
        assert!(close(arr.get(5, 6), 0.356036009069));
    }



    #[test]
    fn test_index_mut_3() {

        let mut arr = Array::from(vec![0.3647979523539372,
                                       0.36308406394227044,
                                       0.21404950758183616,
                                       0.36811953573544476,
                                       0.15420979571680848,
                                       0.7091867671879617,
                                       0.8245692241181685,
                                       0.28601877391422614,
                                       0.7053682579186311,
                                       0.9436051798229766,
                                       0.13564080650832278,
                                       0.49162020823877484,
                                       0.6575486409921484,
                                       0.5224264019283387,
                                       0.1304045608362886,
                                       0.40313708114722413,
                                       0.4123952289574855,
                                       0.4308186558945438,
                                       0.11908643991366652,
                                       0.2579691080534129,
                                       0.47102938170577524,
                                       0.878796734322898,
                                       0.7789561501543262,
                                       0.7959634630696436,
                                       0.004418088734142178,
                                       0.8552923824803051,
                                       0.19673926667104624,
                                       0.9213117917011139,
                                       0.11573887674353178,
                                       0.09984725008755602,
                                       0.4149531641983125,
                                       0.8301283257987035,
                                       0.6583325997105612,
                                       0.8405620427928018,
                                       0.29872918139103655,
                                       0.2913539353436094,
                                       0.21961401853166496,
                                       0.8731108344033446,
                                       0.9925319133165988,
                                       0.12493108260697727,
                                       0.5167221149865642,
                                       0.35603600906937594]);
        arr.reshape(7, 6);

        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.36479795235));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.36308406394));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.21404950758));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.36811953574));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.15420979572));
        let mut v = arr.get(0, 5);
        v += 1.0;
        assert!(close(v, 1.70918676719));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.82456922412));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.28601877391));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.70536825792));
        let mut v = arr.get(1, 3);
        v += 1.0;
        assert!(close(v, 1.94360517982));
        let mut v = arr.get(1, 4);
        v += 1.0;
        assert!(close(v, 1.13564080651));
        let mut v = arr.get(1, 5);
        v += 1.0;
        assert!(close(v, 1.49162020824));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.65754864099));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.52242640193));
        let mut v = arr.get(2, 2);
        v += 1.0;
        assert!(close(v, 1.13040456084));
        let mut v = arr.get(2, 3);
        v += 1.0;
        assert!(close(v, 1.40313708115));
        let mut v = arr.get(2, 4);
        v += 1.0;
        assert!(close(v, 1.41239522896));
        let mut v = arr.get(2, 5);
        v += 1.0;
        assert!(close(v, 1.43081865589));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.11908643991));
        let mut v = arr.get(3, 1);
        v += 1.0;
        assert!(close(v, 1.25796910805));
        let mut v = arr.get(3, 2);
        v += 1.0;
        assert!(close(v, 1.47102938171));
        let mut v = arr.get(3, 3);
        v += 1.0;
        assert!(close(v, 1.87879673432));
        let mut v = arr.get(3, 4);
        v += 1.0;
        assert!(close(v, 1.77895615015));
        let mut v = arr.get(3, 5);
        v += 1.0;
        assert!(close(v, 1.79596346307));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.00441808873));
        let mut v = arr.get(4, 1);
        v += 1.0;
        assert!(close(v, 1.85529238248));
        let mut v = arr.get(4, 2);
        v += 1.0;
        assert!(close(v, 1.19673926667));
        let mut v = arr.get(4, 3);
        v += 1.0;
        assert!(close(v, 1.9213117917));
        let mut v = arr.get(4, 4);
        v += 1.0;
        assert!(close(v, 1.11573887674));
        let mut v = arr.get(4, 5);
        v += 1.0;
        assert!(close(v, 1.09984725009));
        let mut v = arr.get(5, 0);
        v += 1.0;
        assert!(close(v, 1.4149531642));
        let mut v = arr.get(5, 1);
        v += 1.0;
        assert!(close(v, 1.8301283258));
        let mut v = arr.get(5, 2);
        v += 1.0;
        assert!(close(v, 1.65833259971));
        let mut v = arr.get(5, 3);
        v += 1.0;
        assert!(close(v, 1.84056204279));
        let mut v = arr.get(5, 4);
        v += 1.0;
        assert!(close(v, 1.29872918139));
        let mut v = arr.get(5, 5);
        v += 1.0;
        assert!(close(v, 1.29135393534));
        let mut v = arr.get(6, 0);
        v += 1.0;
        assert!(close(v, 1.21961401853));
        let mut v = arr.get(6, 1);
        v += 1.0;
        assert!(close(v, 1.8731108344));
        let mut v = arr.get(6, 2);
        v += 1.0;
        assert!(close(v, 1.99253191332));
        let mut v = arr.get(6, 3);
        v += 1.0;
        assert!(close(v, 1.12493108261));
        let mut v = arr.get(6, 4);
        v += 1.0;
        assert!(close(v, 1.51672211499));
        let mut v = arr.get(6, 5);
        v += 1.0;
        assert!(close(v, 1.35603600907));
    }



    #[test]
    fn test_index_transpose_mut_3() {

        let mut arr = Array::from(vec![0.3647979523539372,
                                       0.36308406394227044,
                                       0.21404950758183616,
                                       0.36811953573544476,
                                       0.15420979571680848,
                                       0.7091867671879617,
                                       0.8245692241181685,
                                       0.28601877391422614,
                                       0.7053682579186311,
                                       0.9436051798229766,
                                       0.13564080650832278,
                                       0.49162020823877484,
                                       0.6575486409921484,
                                       0.5224264019283387,
                                       0.1304045608362886,
                                       0.40313708114722413,
                                       0.4123952289574855,
                                       0.4308186558945438,
                                       0.11908643991366652,
                                       0.2579691080534129,
                                       0.47102938170577524,
                                       0.878796734322898,
                                       0.7789561501543262,
                                       0.7959634630696436,
                                       0.004418088734142178,
                                       0.8552923824803051,
                                       0.19673926667104624,
                                       0.9213117917011139,
                                       0.11573887674353178,
                                       0.09984725008755602,
                                       0.4149531641983125,
                                       0.8301283257987035,
                                       0.6583325997105612,
                                       0.8405620427928018,
                                       0.29872918139103655,
                                       0.2913539353436094,
                                       0.21961401853166496,
                                       0.8731108344033446,
                                       0.9925319133165988,
                                       0.12493108260697727,
                                       0.5167221149865642,
                                       0.35603600906937594]);
        arr.reshape(7, 6);

        let arr = arr.T();
        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.36479795235));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.36308406394));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.21404950758));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.36811953574));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.15420979572));
        let mut v = arr.get(5, 0);
        v += 1.0;
        assert!(close(v, 1.70918676719));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.82456922412));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.28601877391));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.70536825792));
        let mut v = arr.get(3, 1);
        v += 1.0;
        assert!(close(v, 1.94360517982));
        let mut v = arr.get(4, 1);
        v += 1.0;
        assert!(close(v, 1.13564080651));
        let mut v = arr.get(5, 1);
        v += 1.0;
        assert!(close(v, 1.49162020824));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.65754864099));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.52242640193));
        let mut v = arr.get(2, 2);
        v += 1.0;
        assert!(close(v, 1.13040456084));
        let mut v = arr.get(3, 2);
        v += 1.0;
        assert!(close(v, 1.40313708115));
        let mut v = arr.get(4, 2);
        v += 1.0;
        assert!(close(v, 1.41239522896));
        let mut v = arr.get(5, 2);
        v += 1.0;
        assert!(close(v, 1.43081865589));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.11908643991));
        let mut v = arr.get(1, 3);
        v += 1.0;
        assert!(close(v, 1.25796910805));
        let mut v = arr.get(2, 3);
        v += 1.0;
        assert!(close(v, 1.47102938171));
        let mut v = arr.get(3, 3);
        v += 1.0;
        assert!(close(v, 1.87879673432));
        let mut v = arr.get(4, 3);
        v += 1.0;
        assert!(close(v, 1.77895615015));
        let mut v = arr.get(5, 3);
        v += 1.0;
        assert!(close(v, 1.79596346307));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.00441808873));
        let mut v = arr.get(1, 4);
        v += 1.0;
        assert!(close(v, 1.85529238248));
        let mut v = arr.get(2, 4);
        v += 1.0;
        assert!(close(v, 1.19673926667));
        let mut v = arr.get(3, 4);
        v += 1.0;
        assert!(close(v, 1.9213117917));
        let mut v = arr.get(4, 4);
        v += 1.0;
        assert!(close(v, 1.11573887674));
        let mut v = arr.get(5, 4);
        v += 1.0;
        assert!(close(v, 1.09984725009));
        let mut v = arr.get(0, 5);
        v += 1.0;
        assert!(close(v, 1.4149531642));
        let mut v = arr.get(1, 5);
        v += 1.0;
        assert!(close(v, 1.8301283258));
        let mut v = arr.get(2, 5);
        v += 1.0;
        assert!(close(v, 1.65833259971));
        let mut v = arr.get(3, 5);
        v += 1.0;
        assert!(close(v, 1.84056204279));
        let mut v = arr.get(4, 5);
        v += 1.0;
        assert!(close(v, 1.29872918139));
        let mut v = arr.get(5, 5);
        v += 1.0;
        assert!(close(v, 1.29135393534));
        let mut v = arr.get(0, 6);
        v += 1.0;
        assert!(close(v, 1.21961401853));
        let mut v = arr.get(1, 6);
        v += 1.0;
        assert!(close(v, 1.8731108344));
        let mut v = arr.get(2, 6);
        v += 1.0;
        assert!(close(v, 1.99253191332));
        let mut v = arr.get(3, 6);
        v += 1.0;
        assert!(close(v, 1.12493108261));
        let mut v = arr.get(4, 6);
        v += 1.0;
        assert!(close(v, 1.51672211499));
        let mut v = arr.get(5, 6);
        v += 1.0;
        assert!(close(v, 1.35603600907));
    }



    #[test]
    fn test_index_unsafe_3() {

        let mut arr = Array::from(vec![0.3647979523539372,
                                       0.36308406394227044,
                                       0.21404950758183616,
                                       0.36811953573544476,
                                       0.15420979571680848,
                                       0.7091867671879617,
                                       0.8245692241181685,
                                       0.28601877391422614,
                                       0.7053682579186311,
                                       0.9436051798229766,
                                       0.13564080650832278,
                                       0.49162020823877484,
                                       0.6575486409921484,
                                       0.5224264019283387,
                                       0.1304045608362886,
                                       0.40313708114722413,
                                       0.4123952289574855,
                                       0.4308186558945438,
                                       0.11908643991366652,
                                       0.2579691080534129,
                                       0.47102938170577524,
                                       0.878796734322898,
                                       0.7789561501543262,
                                       0.7959634630696436,
                                       0.004418088734142178,
                                       0.8552923824803051,
                                       0.19673926667104624,
                                       0.9213117917011139,
                                       0.11573887674353178,
                                       0.09984725008755602,
                                       0.4149531641983125,
                                       0.8301283257987035,
                                       0.6583325997105612,
                                       0.8405620427928018,
                                       0.29872918139103655,
                                       0.2913539353436094,
                                       0.21961401853166496,
                                       0.8731108344033446,
                                       0.9925319133165988,
                                       0.12493108260697727,
                                       0.5167221149865642,
                                       0.35603600906937594]);
        arr.reshape(7, 6);

        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.364797952354));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.363084063942));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.214049507582));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.368119535735));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.154209795717));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 5), 0.709186767188));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.824569224118));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.286018773914));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.705368257919));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 3), 0.943605179823));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 4), 0.135640806508));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 5), 0.491620208239));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.657548640992));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.522426401928));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 2), 0.130404560836));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 3), 0.403137081147));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 4), 0.412395228957));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 5), 0.430818655895));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.119086439914));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 1), 0.257969108053));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 2), 0.471029381706));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 3), 0.878796734323));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 4), 0.778956150154));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 5), 0.79596346307));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.00441808873414));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 1), 0.85529238248));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 2), 0.196739266671));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 3), 0.921311791701));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 4), 0.115738876744));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 5), 0.0998472500876));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 0), 0.414953164198));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 1), 0.830128325799));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 2), 0.658332599711));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 3), 0.840562042793));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 4), 0.298729181391));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 5), 0.291353935344));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 0), 0.219614018532));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 1), 0.873110834403));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 2), 0.992531913317));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 3), 0.124931082607));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 4), 0.516722114987));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 5), 0.356036009069));
        };
    }



    #[test]
    fn test_index_transpose_unsafe_3() {

        let mut arr = Array::from(vec![0.3647979523539372,
                                       0.36308406394227044,
                                       0.21404950758183616,
                                       0.36811953573544476,
                                       0.15420979571680848,
                                       0.7091867671879617,
                                       0.8245692241181685,
                                       0.28601877391422614,
                                       0.7053682579186311,
                                       0.9436051798229766,
                                       0.13564080650832278,
                                       0.49162020823877484,
                                       0.6575486409921484,
                                       0.5224264019283387,
                                       0.1304045608362886,
                                       0.40313708114722413,
                                       0.4123952289574855,
                                       0.4308186558945438,
                                       0.11908643991366652,
                                       0.2579691080534129,
                                       0.47102938170577524,
                                       0.878796734322898,
                                       0.7789561501543262,
                                       0.7959634630696436,
                                       0.004418088734142178,
                                       0.8552923824803051,
                                       0.19673926667104624,
                                       0.9213117917011139,
                                       0.11573887674353178,
                                       0.09984725008755602,
                                       0.4149531641983125,
                                       0.8301283257987035,
                                       0.6583325997105612,
                                       0.8405620427928018,
                                       0.29872918139103655,
                                       0.2913539353436094,
                                       0.21961401853166496,
                                       0.8731108344033446,
                                       0.9925319133165988,
                                       0.12493108260697727,
                                       0.5167221149865642,
                                       0.35603600906937594]);
        arr.reshape(7, 6);

        let arr = arr.T();
        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.364797952354));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.363084063942));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.214049507582));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.368119535735));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.154209795717));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 0), 0.709186767188));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.824569224118));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.286018773914));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.705368257919));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 1), 0.943605179823));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 1), 0.135640806508));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 1), 0.491620208239));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.657548640992));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.522426401928));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 2), 0.130404560836));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 2), 0.403137081147));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 2), 0.412395228957));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 2), 0.430818655895));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.119086439914));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 3), 0.257969108053));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 3), 0.471029381706));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 3), 0.878796734323));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 3), 0.778956150154));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 3), 0.79596346307));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.00441808873414));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 4), 0.85529238248));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 4), 0.196739266671));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 4), 0.921311791701));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 4), 0.115738876744));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 4), 0.0998472500876));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 5), 0.414953164198));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 5), 0.830128325799));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 5), 0.658332599711));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 5), 0.840562042793));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 5), 0.298729181391));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 5), 0.291353935344));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 6), 0.219614018532));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 6), 0.873110834403));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 6), 0.992531913317));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 6), 0.124931082607));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 6), 0.516722114987));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 6), 0.356036009069));
        };
    }



    #[test]
    fn test_index_4() {

        let mut arr = Array::from(vec![0.5053414095220631,
                                       0.9515944229974294,
                                       0.01869972616290927,
                                       0.3651095484212574,
                                       0.8093171436120703,
                                       0.9938563301832937,
                                       0.7758112569774406,
                                       0.46560288920814796,
                                       0.8620975137755558,
                                       0.17856062156157082,
                                       0.2541026841563959,
                                       0.07316076458101406,
                                       0.15855693769656998,
                                       0.9379247087641616,
                                       0.6889503228688164,
                                       0.11422222893176381,
                                       0.3136968489406069,
                                       0.3251977875790155,
                                       0.7135826937372265,
                                       0.7586005116188119,
                                       0.7254964300735486,
                                       0.8396463691221457,
                                       0.43328029656121825,
                                       0.3686468314958711,
                                       0.7397710935379666,
                                       0.4497911236174056,
                                       0.5277789783225971,
                                       0.22823121143029412,
                                       0.7205020351076907,
                                       0.2132560721407628,
                                       0.37245617251888463,
                                       0.40826816005663624,
                                       0.7529853065158498,
                                       0.9729367471961934,
                                       0.048377437598617234,
                                       0.09664827683400845,
                                       0.7560699295668065,
                                       0.4478976116896861,
                                       0.558090641317851,
                                       0.3656423016037962,
                                       0.33863293933524385,
                                       0.23582037368450148,
                                       0.22741518352824397,
                                       0.09084584446404942,
                                       0.8013604880752093,
                                       0.1843352626509892,
                                       0.1665774834355107,
                                       0.87658036046777,
                                       0.3009038897952965,
                                       0.08246224260539736,
                                       0.5704847701699387,
                                       0.5819718051730493,
                                       0.4394951741102917,
                                       0.21381802195045596,
                                       0.8467866649649154,
                                       0.2865978160316519,
                                       0.9874348113942802,
                                       0.35161673710515395,
                                       0.9226350504489396,
                                       0.9679307765092823,
                                       0.17781774635851644,
                                       0.18987386900845993,
                                       0.46406215038482046,
                                       0.33304177328203266,
                                       0.8178083065304194,
                                       0.492501643062211,
                                       0.8463273348799848,
                                       0.8002574160133654,
                                       0.17853709265446838,
                                       0.3800898764290961,
                                       0.591937855111794,
                                       0.6308336324475695]);
        arr.reshape(9, 8);

        assert!(close(arr.get(0, 0), 0.505341409522));
        assert!(close(arr.get(0, 1), 0.951594422997));
        assert!(close(arr.get(0, 2), 0.0186997261629));
        assert!(close(arr.get(0, 3), 0.365109548421));
        assert!(close(arr.get(0, 4), 0.809317143612));
        assert!(close(arr.get(0, 5), 0.993856330183));
        assert!(close(arr.get(0, 6), 0.775811256977));
        assert!(close(arr.get(0, 7), 0.465602889208));
        assert!(close(arr.get(1, 0), 0.862097513776));
        assert!(close(arr.get(1, 1), 0.178560621562));
        assert!(close(arr.get(1, 2), 0.254102684156));
        assert!(close(arr.get(1, 3), 0.073160764581));
        assert!(close(arr.get(1, 4), 0.158556937697));
        assert!(close(arr.get(1, 5), 0.937924708764));
        assert!(close(arr.get(1, 6), 0.688950322869));
        assert!(close(arr.get(1, 7), 0.114222228932));
        assert!(close(arr.get(2, 0), 0.313696848941));
        assert!(close(arr.get(2, 1), 0.325197787579));
        assert!(close(arr.get(2, 2), 0.713582693737));
        assert!(close(arr.get(2, 3), 0.758600511619));
        assert!(close(arr.get(2, 4), 0.725496430074));
        assert!(close(arr.get(2, 5), 0.839646369122));
        assert!(close(arr.get(2, 6), 0.433280296561));
        assert!(close(arr.get(2, 7), 0.368646831496));
        assert!(close(arr.get(3, 0), 0.739771093538));
        assert!(close(arr.get(3, 1), 0.449791123617));
        assert!(close(arr.get(3, 2), 0.527778978323));
        assert!(close(arr.get(3, 3), 0.22823121143));
        assert!(close(arr.get(3, 4), 0.720502035108));
        assert!(close(arr.get(3, 5), 0.213256072141));
        assert!(close(arr.get(3, 6), 0.372456172519));
        assert!(close(arr.get(3, 7), 0.408268160057));
        assert!(close(arr.get(4, 0), 0.752985306516));
        assert!(close(arr.get(4, 1), 0.972936747196));
        assert!(close(arr.get(4, 2), 0.0483774375986));
        assert!(close(arr.get(4, 3), 0.096648276834));
        assert!(close(arr.get(4, 4), 0.756069929567));
        assert!(close(arr.get(4, 5), 0.44789761169));
        assert!(close(arr.get(4, 6), 0.558090641318));
        assert!(close(arr.get(4, 7), 0.365642301604));
        assert!(close(arr.get(5, 0), 0.338632939335));
        assert!(close(arr.get(5, 1), 0.235820373685));
        assert!(close(arr.get(5, 2), 0.227415183528));
        assert!(close(arr.get(5, 3), 0.090845844464));
        assert!(close(arr.get(5, 4), 0.801360488075));
        assert!(close(arr.get(5, 5), 0.184335262651));
        assert!(close(arr.get(5, 6), 0.166577483436));
        assert!(close(arr.get(5, 7), 0.876580360468));
        assert!(close(arr.get(6, 0), 0.300903889795));
        assert!(close(arr.get(6, 1), 0.0824622426054));
        assert!(close(arr.get(6, 2), 0.57048477017));
        assert!(close(arr.get(6, 3), 0.581971805173));
        assert!(close(arr.get(6, 4), 0.43949517411));
        assert!(close(arr.get(6, 5), 0.21381802195));
        assert!(close(arr.get(6, 6), 0.846786664965));
        assert!(close(arr.get(6, 7), 0.286597816032));
        assert!(close(arr.get(7, 0), 0.987434811394));
        assert!(close(arr.get(7, 1), 0.351616737105));
        assert!(close(arr.get(7, 2), 0.922635050449));
        assert!(close(arr.get(7, 3), 0.967930776509));
        assert!(close(arr.get(7, 4), 0.177817746359));
        assert!(close(arr.get(7, 5), 0.189873869008));
        assert!(close(arr.get(7, 6), 0.464062150385));
        assert!(close(arr.get(7, 7), 0.333041773282));
        assert!(close(arr.get(8, 0), 0.81780830653));
        assert!(close(arr.get(8, 1), 0.492501643062));
        assert!(close(arr.get(8, 2), 0.84632733488));
        assert!(close(arr.get(8, 3), 0.800257416013));
        assert!(close(arr.get(8, 4), 0.178537092654));
        assert!(close(arr.get(8, 5), 0.380089876429));
        assert!(close(arr.get(8, 6), 0.591937855112));
        assert!(close(arr.get(8, 7), 0.630833632448));
    }



    #[test]
    fn test_index_transpose_4() {

        let mut arr = Array::from(vec![0.5053414095220631,
                                       0.9515944229974294,
                                       0.01869972616290927,
                                       0.3651095484212574,
                                       0.8093171436120703,
                                       0.9938563301832937,
                                       0.7758112569774406,
                                       0.46560288920814796,
                                       0.8620975137755558,
                                       0.17856062156157082,
                                       0.2541026841563959,
                                       0.07316076458101406,
                                       0.15855693769656998,
                                       0.9379247087641616,
                                       0.6889503228688164,
                                       0.11422222893176381,
                                       0.3136968489406069,
                                       0.3251977875790155,
                                       0.7135826937372265,
                                       0.7586005116188119,
                                       0.7254964300735486,
                                       0.8396463691221457,
                                       0.43328029656121825,
                                       0.3686468314958711,
                                       0.7397710935379666,
                                       0.4497911236174056,
                                       0.5277789783225971,
                                       0.22823121143029412,
                                       0.7205020351076907,
                                       0.2132560721407628,
                                       0.37245617251888463,
                                       0.40826816005663624,
                                       0.7529853065158498,
                                       0.9729367471961934,
                                       0.048377437598617234,
                                       0.09664827683400845,
                                       0.7560699295668065,
                                       0.4478976116896861,
                                       0.558090641317851,
                                       0.3656423016037962,
                                       0.33863293933524385,
                                       0.23582037368450148,
                                       0.22741518352824397,
                                       0.09084584446404942,
                                       0.8013604880752093,
                                       0.1843352626509892,
                                       0.1665774834355107,
                                       0.87658036046777,
                                       0.3009038897952965,
                                       0.08246224260539736,
                                       0.5704847701699387,
                                       0.5819718051730493,
                                       0.4394951741102917,
                                       0.21381802195045596,
                                       0.8467866649649154,
                                       0.2865978160316519,
                                       0.9874348113942802,
                                       0.35161673710515395,
                                       0.9226350504489396,
                                       0.9679307765092823,
                                       0.17781774635851644,
                                       0.18987386900845993,
                                       0.46406215038482046,
                                       0.33304177328203266,
                                       0.8178083065304194,
                                       0.492501643062211,
                                       0.8463273348799848,
                                       0.8002574160133654,
                                       0.17853709265446838,
                                       0.3800898764290961,
                                       0.591937855111794,
                                       0.6308336324475695]);
        arr.reshape(9, 8);

        let arr = arr.T();
        assert!(close(arr.get(0, 0), 0.505341409522));
        assert!(close(arr.get(1, 0), 0.951594422997));
        assert!(close(arr.get(2, 0), 0.0186997261629));
        assert!(close(arr.get(3, 0), 0.365109548421));
        assert!(close(arr.get(4, 0), 0.809317143612));
        assert!(close(arr.get(5, 0), 0.993856330183));
        assert!(close(arr.get(6, 0), 0.775811256977));
        assert!(close(arr.get(7, 0), 0.465602889208));
        assert!(close(arr.get(0, 1), 0.862097513776));
        assert!(close(arr.get(1, 1), 0.178560621562));
        assert!(close(arr.get(2, 1), 0.254102684156));
        assert!(close(arr.get(3, 1), 0.073160764581));
        assert!(close(arr.get(4, 1), 0.158556937697));
        assert!(close(arr.get(5, 1), 0.937924708764));
        assert!(close(arr.get(6, 1), 0.688950322869));
        assert!(close(arr.get(7, 1), 0.114222228932));
        assert!(close(arr.get(0, 2), 0.313696848941));
        assert!(close(arr.get(1, 2), 0.325197787579));
        assert!(close(arr.get(2, 2), 0.713582693737));
        assert!(close(arr.get(3, 2), 0.758600511619));
        assert!(close(arr.get(4, 2), 0.725496430074));
        assert!(close(arr.get(5, 2), 0.839646369122));
        assert!(close(arr.get(6, 2), 0.433280296561));
        assert!(close(arr.get(7, 2), 0.368646831496));
        assert!(close(arr.get(0, 3), 0.739771093538));
        assert!(close(arr.get(1, 3), 0.449791123617));
        assert!(close(arr.get(2, 3), 0.527778978323));
        assert!(close(arr.get(3, 3), 0.22823121143));
        assert!(close(arr.get(4, 3), 0.720502035108));
        assert!(close(arr.get(5, 3), 0.213256072141));
        assert!(close(arr.get(6, 3), 0.372456172519));
        assert!(close(arr.get(7, 3), 0.408268160057));
        assert!(close(arr.get(0, 4), 0.752985306516));
        assert!(close(arr.get(1, 4), 0.972936747196));
        assert!(close(arr.get(2, 4), 0.0483774375986));
        assert!(close(arr.get(3, 4), 0.096648276834));
        assert!(close(arr.get(4, 4), 0.756069929567));
        assert!(close(arr.get(5, 4), 0.44789761169));
        assert!(close(arr.get(6, 4), 0.558090641318));
        assert!(close(arr.get(7, 4), 0.365642301604));
        assert!(close(arr.get(0, 5), 0.338632939335));
        assert!(close(arr.get(1, 5), 0.235820373685));
        assert!(close(arr.get(2, 5), 0.227415183528));
        assert!(close(arr.get(3, 5), 0.090845844464));
        assert!(close(arr.get(4, 5), 0.801360488075));
        assert!(close(arr.get(5, 5), 0.184335262651));
        assert!(close(arr.get(6, 5), 0.166577483436));
        assert!(close(arr.get(7, 5), 0.876580360468));
        assert!(close(arr.get(0, 6), 0.300903889795));
        assert!(close(arr.get(1, 6), 0.0824622426054));
        assert!(close(arr.get(2, 6), 0.57048477017));
        assert!(close(arr.get(3, 6), 0.581971805173));
        assert!(close(arr.get(4, 6), 0.43949517411));
        assert!(close(arr.get(5, 6), 0.21381802195));
        assert!(close(arr.get(6, 6), 0.846786664965));
        assert!(close(arr.get(7, 6), 0.286597816032));
        assert!(close(arr.get(0, 7), 0.987434811394));
        assert!(close(arr.get(1, 7), 0.351616737105));
        assert!(close(arr.get(2, 7), 0.922635050449));
        assert!(close(arr.get(3, 7), 0.967930776509));
        assert!(close(arr.get(4, 7), 0.177817746359));
        assert!(close(arr.get(5, 7), 0.189873869008));
        assert!(close(arr.get(6, 7), 0.464062150385));
        assert!(close(arr.get(7, 7), 0.333041773282));
        assert!(close(arr.get(0, 8), 0.81780830653));
        assert!(close(arr.get(1, 8), 0.492501643062));
        assert!(close(arr.get(2, 8), 0.84632733488));
        assert!(close(arr.get(3, 8), 0.800257416013));
        assert!(close(arr.get(4, 8), 0.178537092654));
        assert!(close(arr.get(5, 8), 0.380089876429));
        assert!(close(arr.get(6, 8), 0.591937855112));
        assert!(close(arr.get(7, 8), 0.630833632448));
    }



    #[test]
    fn test_index_mut_4() {

        let mut arr = Array::from(vec![0.5053414095220631,
                                       0.9515944229974294,
                                       0.01869972616290927,
                                       0.3651095484212574,
                                       0.8093171436120703,
                                       0.9938563301832937,
                                       0.7758112569774406,
                                       0.46560288920814796,
                                       0.8620975137755558,
                                       0.17856062156157082,
                                       0.2541026841563959,
                                       0.07316076458101406,
                                       0.15855693769656998,
                                       0.9379247087641616,
                                       0.6889503228688164,
                                       0.11422222893176381,
                                       0.3136968489406069,
                                       0.3251977875790155,
                                       0.7135826937372265,
                                       0.7586005116188119,
                                       0.7254964300735486,
                                       0.8396463691221457,
                                       0.43328029656121825,
                                       0.3686468314958711,
                                       0.7397710935379666,
                                       0.4497911236174056,
                                       0.5277789783225971,
                                       0.22823121143029412,
                                       0.7205020351076907,
                                       0.2132560721407628,
                                       0.37245617251888463,
                                       0.40826816005663624,
                                       0.7529853065158498,
                                       0.9729367471961934,
                                       0.048377437598617234,
                                       0.09664827683400845,
                                       0.7560699295668065,
                                       0.4478976116896861,
                                       0.558090641317851,
                                       0.3656423016037962,
                                       0.33863293933524385,
                                       0.23582037368450148,
                                       0.22741518352824397,
                                       0.09084584446404942,
                                       0.8013604880752093,
                                       0.1843352626509892,
                                       0.1665774834355107,
                                       0.87658036046777,
                                       0.3009038897952965,
                                       0.08246224260539736,
                                       0.5704847701699387,
                                       0.5819718051730493,
                                       0.4394951741102917,
                                       0.21381802195045596,
                                       0.8467866649649154,
                                       0.2865978160316519,
                                       0.9874348113942802,
                                       0.35161673710515395,
                                       0.9226350504489396,
                                       0.9679307765092823,
                                       0.17781774635851644,
                                       0.18987386900845993,
                                       0.46406215038482046,
                                       0.33304177328203266,
                                       0.8178083065304194,
                                       0.492501643062211,
                                       0.8463273348799848,
                                       0.8002574160133654,
                                       0.17853709265446838,
                                       0.3800898764290961,
                                       0.591937855111794,
                                       0.6308336324475695]);
        arr.reshape(9, 8);

        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.50534140952));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.951594423));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.01869972616));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.36510954842));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.80931714361));
        let mut v = arr.get(0, 5);
        v += 1.0;
        assert!(close(v, 1.99385633018));
        let mut v = arr.get(0, 6);
        v += 1.0;
        assert!(close(v, 1.77581125698));
        let mut v = arr.get(0, 7);
        v += 1.0;
        assert!(close(v, 1.46560288921));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.86209751378));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.17856062156));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.25410268416));
        let mut v = arr.get(1, 3);
        v += 1.0;
        assert!(close(v, 1.07316076458));
        let mut v = arr.get(1, 4);
        v += 1.0;
        assert!(close(v, 1.1585569377));
        let mut v = arr.get(1, 5);
        v += 1.0;
        assert!(close(v, 1.93792470876));
        let mut v = arr.get(1, 6);
        v += 1.0;
        assert!(close(v, 1.68895032287));
        let mut v = arr.get(1, 7);
        v += 1.0;
        assert!(close(v, 1.11422222893));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.31369684894));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.32519778758));
        let mut v = arr.get(2, 2);
        v += 1.0;
        assert!(close(v, 1.71358269374));
        let mut v = arr.get(2, 3);
        v += 1.0;
        assert!(close(v, 1.75860051162));
        let mut v = arr.get(2, 4);
        v += 1.0;
        assert!(close(v, 1.72549643007));
        let mut v = arr.get(2, 5);
        v += 1.0;
        assert!(close(v, 1.83964636912));
        let mut v = arr.get(2, 6);
        v += 1.0;
        assert!(close(v, 1.43328029656));
        let mut v = arr.get(2, 7);
        v += 1.0;
        assert!(close(v, 1.3686468315));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.73977109354));
        let mut v = arr.get(3, 1);
        v += 1.0;
        assert!(close(v, 1.44979112362));
        let mut v = arr.get(3, 2);
        v += 1.0;
        assert!(close(v, 1.52777897832));
        let mut v = arr.get(3, 3);
        v += 1.0;
        assert!(close(v, 1.22823121143));
        let mut v = arr.get(3, 4);
        v += 1.0;
        assert!(close(v, 1.72050203511));
        let mut v = arr.get(3, 5);
        v += 1.0;
        assert!(close(v, 1.21325607214));
        let mut v = arr.get(3, 6);
        v += 1.0;
        assert!(close(v, 1.37245617252));
        let mut v = arr.get(3, 7);
        v += 1.0;
        assert!(close(v, 1.40826816006));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.75298530652));
        let mut v = arr.get(4, 1);
        v += 1.0;
        assert!(close(v, 1.9729367472));
        let mut v = arr.get(4, 2);
        v += 1.0;
        assert!(close(v, 1.0483774376));
        let mut v = arr.get(4, 3);
        v += 1.0;
        assert!(close(v, 1.09664827683));
        let mut v = arr.get(4, 4);
        v += 1.0;
        assert!(close(v, 1.75606992957));
        let mut v = arr.get(4, 5);
        v += 1.0;
        assert!(close(v, 1.44789761169));
        let mut v = arr.get(4, 6);
        v += 1.0;
        assert!(close(v, 1.55809064132));
        let mut v = arr.get(4, 7);
        v += 1.0;
        assert!(close(v, 1.3656423016));
        let mut v = arr.get(5, 0);
        v += 1.0;
        assert!(close(v, 1.33863293934));
        let mut v = arr.get(5, 1);
        v += 1.0;
        assert!(close(v, 1.23582037368));
        let mut v = arr.get(5, 2);
        v += 1.0;
        assert!(close(v, 1.22741518353));
        let mut v = arr.get(5, 3);
        v += 1.0;
        assert!(close(v, 1.09084584446));
        let mut v = arr.get(5, 4);
        v += 1.0;
        assert!(close(v, 1.80136048808));
        let mut v = arr.get(5, 5);
        v += 1.0;
        assert!(close(v, 1.18433526265));
        let mut v = arr.get(5, 6);
        v += 1.0;
        assert!(close(v, 1.16657748344));
        let mut v = arr.get(5, 7);
        v += 1.0;
        assert!(close(v, 1.87658036047));
        let mut v = arr.get(6, 0);
        v += 1.0;
        assert!(close(v, 1.3009038898));
        let mut v = arr.get(6, 1);
        v += 1.0;
        assert!(close(v, 1.08246224261));
        let mut v = arr.get(6, 2);
        v += 1.0;
        assert!(close(v, 1.57048477017));
        let mut v = arr.get(6, 3);
        v += 1.0;
        assert!(close(v, 1.58197180517));
        let mut v = arr.get(6, 4);
        v += 1.0;
        assert!(close(v, 1.43949517411));
        let mut v = arr.get(6, 5);
        v += 1.0;
        assert!(close(v, 1.21381802195));
        let mut v = arr.get(6, 6);
        v += 1.0;
        assert!(close(v, 1.84678666496));
        let mut v = arr.get(6, 7);
        v += 1.0;
        assert!(close(v, 1.28659781603));
        let mut v = arr.get(7, 0);
        v += 1.0;
        assert!(close(v, 1.98743481139));
        let mut v = arr.get(7, 1);
        v += 1.0;
        assert!(close(v, 1.35161673711));
        let mut v = arr.get(7, 2);
        v += 1.0;
        assert!(close(v, 1.92263505045));
        let mut v = arr.get(7, 3);
        v += 1.0;
        assert!(close(v, 1.96793077651));
        let mut v = arr.get(7, 4);
        v += 1.0;
        assert!(close(v, 1.17781774636));
        let mut v = arr.get(7, 5);
        v += 1.0;
        assert!(close(v, 1.18987386901));
        let mut v = arr.get(7, 6);
        v += 1.0;
        assert!(close(v, 1.46406215038));
        let mut v = arr.get(7, 7);
        v += 1.0;
        assert!(close(v, 1.33304177328));
        let mut v = arr.get(8, 0);
        v += 1.0;
        assert!(close(v, 1.81780830653));
        let mut v = arr.get(8, 1);
        v += 1.0;
        assert!(close(v, 1.49250164306));
        let mut v = arr.get(8, 2);
        v += 1.0;
        assert!(close(v, 1.84632733488));
        let mut v = arr.get(8, 3);
        v += 1.0;
        assert!(close(v, 1.80025741601));
        let mut v = arr.get(8, 4);
        v += 1.0;
        assert!(close(v, 1.17853709265));
        let mut v = arr.get(8, 5);
        v += 1.0;
        assert!(close(v, 1.38008987643));
        let mut v = arr.get(8, 6);
        v += 1.0;
        assert!(close(v, 1.59193785511));
        let mut v = arr.get(8, 7);
        v += 1.0;
        assert!(close(v, 1.63083363245));
    }



    #[test]
    fn test_index_transpose_mut_4() {

        let mut arr = Array::from(vec![0.5053414095220631,
                                       0.9515944229974294,
                                       0.01869972616290927,
                                       0.3651095484212574,
                                       0.8093171436120703,
                                       0.9938563301832937,
                                       0.7758112569774406,
                                       0.46560288920814796,
                                       0.8620975137755558,
                                       0.17856062156157082,
                                       0.2541026841563959,
                                       0.07316076458101406,
                                       0.15855693769656998,
                                       0.9379247087641616,
                                       0.6889503228688164,
                                       0.11422222893176381,
                                       0.3136968489406069,
                                       0.3251977875790155,
                                       0.7135826937372265,
                                       0.7586005116188119,
                                       0.7254964300735486,
                                       0.8396463691221457,
                                       0.43328029656121825,
                                       0.3686468314958711,
                                       0.7397710935379666,
                                       0.4497911236174056,
                                       0.5277789783225971,
                                       0.22823121143029412,
                                       0.7205020351076907,
                                       0.2132560721407628,
                                       0.37245617251888463,
                                       0.40826816005663624,
                                       0.7529853065158498,
                                       0.9729367471961934,
                                       0.048377437598617234,
                                       0.09664827683400845,
                                       0.7560699295668065,
                                       0.4478976116896861,
                                       0.558090641317851,
                                       0.3656423016037962,
                                       0.33863293933524385,
                                       0.23582037368450148,
                                       0.22741518352824397,
                                       0.09084584446404942,
                                       0.8013604880752093,
                                       0.1843352626509892,
                                       0.1665774834355107,
                                       0.87658036046777,
                                       0.3009038897952965,
                                       0.08246224260539736,
                                       0.5704847701699387,
                                       0.5819718051730493,
                                       0.4394951741102917,
                                       0.21381802195045596,
                                       0.8467866649649154,
                                       0.2865978160316519,
                                       0.9874348113942802,
                                       0.35161673710515395,
                                       0.9226350504489396,
                                       0.9679307765092823,
                                       0.17781774635851644,
                                       0.18987386900845993,
                                       0.46406215038482046,
                                       0.33304177328203266,
                                       0.8178083065304194,
                                       0.492501643062211,
                                       0.8463273348799848,
                                       0.8002574160133654,
                                       0.17853709265446838,
                                       0.3800898764290961,
                                       0.591937855111794,
                                       0.6308336324475695]);
        arr.reshape(9, 8);

        let arr = arr.T();
        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.50534140952));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.951594423));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.01869972616));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.36510954842));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.80931714361));
        let mut v = arr.get(5, 0);
        v += 1.0;
        assert!(close(v, 1.99385633018));
        let mut v = arr.get(6, 0);
        v += 1.0;
        assert!(close(v, 1.77581125698));
        let mut v = arr.get(7, 0);
        v += 1.0;
        assert!(close(v, 1.46560288921));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.86209751378));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.17856062156));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.25410268416));
        let mut v = arr.get(3, 1);
        v += 1.0;
        assert!(close(v, 1.07316076458));
        let mut v = arr.get(4, 1);
        v += 1.0;
        assert!(close(v, 1.1585569377));
        let mut v = arr.get(5, 1);
        v += 1.0;
        assert!(close(v, 1.93792470876));
        let mut v = arr.get(6, 1);
        v += 1.0;
        assert!(close(v, 1.68895032287));
        let mut v = arr.get(7, 1);
        v += 1.0;
        assert!(close(v, 1.11422222893));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.31369684894));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.32519778758));
        let mut v = arr.get(2, 2);
        v += 1.0;
        assert!(close(v, 1.71358269374));
        let mut v = arr.get(3, 2);
        v += 1.0;
        assert!(close(v, 1.75860051162));
        let mut v = arr.get(4, 2);
        v += 1.0;
        assert!(close(v, 1.72549643007));
        let mut v = arr.get(5, 2);
        v += 1.0;
        assert!(close(v, 1.83964636912));
        let mut v = arr.get(6, 2);
        v += 1.0;
        assert!(close(v, 1.43328029656));
        let mut v = arr.get(7, 2);
        v += 1.0;
        assert!(close(v, 1.3686468315));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.73977109354));
        let mut v = arr.get(1, 3);
        v += 1.0;
        assert!(close(v, 1.44979112362));
        let mut v = arr.get(2, 3);
        v += 1.0;
        assert!(close(v, 1.52777897832));
        let mut v = arr.get(3, 3);
        v += 1.0;
        assert!(close(v, 1.22823121143));
        let mut v = arr.get(4, 3);
        v += 1.0;
        assert!(close(v, 1.72050203511));
        let mut v = arr.get(5, 3);
        v += 1.0;
        assert!(close(v, 1.21325607214));
        let mut v = arr.get(6, 3);
        v += 1.0;
        assert!(close(v, 1.37245617252));
        let mut v = arr.get(7, 3);
        v += 1.0;
        assert!(close(v, 1.40826816006));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.75298530652));
        let mut v = arr.get(1, 4);
        v += 1.0;
        assert!(close(v, 1.9729367472));
        let mut v = arr.get(2, 4);
        v += 1.0;
        assert!(close(v, 1.0483774376));
        let mut v = arr.get(3, 4);
        v += 1.0;
        assert!(close(v, 1.09664827683));
        let mut v = arr.get(4, 4);
        v += 1.0;
        assert!(close(v, 1.75606992957));
        let mut v = arr.get(5, 4);
        v += 1.0;
        assert!(close(v, 1.44789761169));
        let mut v = arr.get(6, 4);
        v += 1.0;
        assert!(close(v, 1.55809064132));
        let mut v = arr.get(7, 4);
        v += 1.0;
        assert!(close(v, 1.3656423016));
        let mut v = arr.get(0, 5);
        v += 1.0;
        assert!(close(v, 1.33863293934));
        let mut v = arr.get(1, 5);
        v += 1.0;
        assert!(close(v, 1.23582037368));
        let mut v = arr.get(2, 5);
        v += 1.0;
        assert!(close(v, 1.22741518353));
        let mut v = arr.get(3, 5);
        v += 1.0;
        assert!(close(v, 1.09084584446));
        let mut v = arr.get(4, 5);
        v += 1.0;
        assert!(close(v, 1.80136048808));
        let mut v = arr.get(5, 5);
        v += 1.0;
        assert!(close(v, 1.18433526265));
        let mut v = arr.get(6, 5);
        v += 1.0;
        assert!(close(v, 1.16657748344));
        let mut v = arr.get(7, 5);
        v += 1.0;
        assert!(close(v, 1.87658036047));
        let mut v = arr.get(0, 6);
        v += 1.0;
        assert!(close(v, 1.3009038898));
        let mut v = arr.get(1, 6);
        v += 1.0;
        assert!(close(v, 1.08246224261));
        let mut v = arr.get(2, 6);
        v += 1.0;
        assert!(close(v, 1.57048477017));
        let mut v = arr.get(3, 6);
        v += 1.0;
        assert!(close(v, 1.58197180517));
        let mut v = arr.get(4, 6);
        v += 1.0;
        assert!(close(v, 1.43949517411));
        let mut v = arr.get(5, 6);
        v += 1.0;
        assert!(close(v, 1.21381802195));
        let mut v = arr.get(6, 6);
        v += 1.0;
        assert!(close(v, 1.84678666496));
        let mut v = arr.get(7, 6);
        v += 1.0;
        assert!(close(v, 1.28659781603));
        let mut v = arr.get(0, 7);
        v += 1.0;
        assert!(close(v, 1.98743481139));
        let mut v = arr.get(1, 7);
        v += 1.0;
        assert!(close(v, 1.35161673711));
        let mut v = arr.get(2, 7);
        v += 1.0;
        assert!(close(v, 1.92263505045));
        let mut v = arr.get(3, 7);
        v += 1.0;
        assert!(close(v, 1.96793077651));
        let mut v = arr.get(4, 7);
        v += 1.0;
        assert!(close(v, 1.17781774636));
        let mut v = arr.get(5, 7);
        v += 1.0;
        assert!(close(v, 1.18987386901));
        let mut v = arr.get(6, 7);
        v += 1.0;
        assert!(close(v, 1.46406215038));
        let mut v = arr.get(7, 7);
        v += 1.0;
        assert!(close(v, 1.33304177328));
        let mut v = arr.get(0, 8);
        v += 1.0;
        assert!(close(v, 1.81780830653));
        let mut v = arr.get(1, 8);
        v += 1.0;
        assert!(close(v, 1.49250164306));
        let mut v = arr.get(2, 8);
        v += 1.0;
        assert!(close(v, 1.84632733488));
        let mut v = arr.get(3, 8);
        v += 1.0;
        assert!(close(v, 1.80025741601));
        let mut v = arr.get(4, 8);
        v += 1.0;
        assert!(close(v, 1.17853709265));
        let mut v = arr.get(5, 8);
        v += 1.0;
        assert!(close(v, 1.38008987643));
        let mut v = arr.get(6, 8);
        v += 1.0;
        assert!(close(v, 1.59193785511));
        let mut v = arr.get(7, 8);
        v += 1.0;
        assert!(close(v, 1.63083363245));
    }



    #[test]
    fn test_index_unsafe_4() {

        let mut arr = Array::from(vec![0.5053414095220631,
                                       0.9515944229974294,
                                       0.01869972616290927,
                                       0.3651095484212574,
                                       0.8093171436120703,
                                       0.9938563301832937,
                                       0.7758112569774406,
                                       0.46560288920814796,
                                       0.8620975137755558,
                                       0.17856062156157082,
                                       0.2541026841563959,
                                       0.07316076458101406,
                                       0.15855693769656998,
                                       0.9379247087641616,
                                       0.6889503228688164,
                                       0.11422222893176381,
                                       0.3136968489406069,
                                       0.3251977875790155,
                                       0.7135826937372265,
                                       0.7586005116188119,
                                       0.7254964300735486,
                                       0.8396463691221457,
                                       0.43328029656121825,
                                       0.3686468314958711,
                                       0.7397710935379666,
                                       0.4497911236174056,
                                       0.5277789783225971,
                                       0.22823121143029412,
                                       0.7205020351076907,
                                       0.2132560721407628,
                                       0.37245617251888463,
                                       0.40826816005663624,
                                       0.7529853065158498,
                                       0.9729367471961934,
                                       0.048377437598617234,
                                       0.09664827683400845,
                                       0.7560699295668065,
                                       0.4478976116896861,
                                       0.558090641317851,
                                       0.3656423016037962,
                                       0.33863293933524385,
                                       0.23582037368450148,
                                       0.22741518352824397,
                                       0.09084584446404942,
                                       0.8013604880752093,
                                       0.1843352626509892,
                                       0.1665774834355107,
                                       0.87658036046777,
                                       0.3009038897952965,
                                       0.08246224260539736,
                                       0.5704847701699387,
                                       0.5819718051730493,
                                       0.4394951741102917,
                                       0.21381802195045596,
                                       0.8467866649649154,
                                       0.2865978160316519,
                                       0.9874348113942802,
                                       0.35161673710515395,
                                       0.9226350504489396,
                                       0.9679307765092823,
                                       0.17781774635851644,
                                       0.18987386900845993,
                                       0.46406215038482046,
                                       0.33304177328203266,
                                       0.8178083065304194,
                                       0.492501643062211,
                                       0.8463273348799848,
                                       0.8002574160133654,
                                       0.17853709265446838,
                                       0.3800898764290961,
                                       0.591937855111794,
                                       0.6308336324475695]);
        arr.reshape(9, 8);

        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.505341409522));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.951594422997));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.0186997261629));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.365109548421));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.809317143612));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 5), 0.993856330183));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 6), 0.775811256977));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 7), 0.465602889208));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.862097513776));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.178560621562));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.254102684156));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 3), 0.073160764581));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 4), 0.158556937697));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 5), 0.937924708764));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 6), 0.688950322869));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 7), 0.114222228932));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.313696848941));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.325197787579));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 2), 0.713582693737));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 3), 0.758600511619));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 4), 0.725496430074));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 5), 0.839646369122));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 6), 0.433280296561));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 7), 0.368646831496));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.739771093538));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 1), 0.449791123617));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 2), 0.527778978323));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 3), 0.22823121143));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 4), 0.720502035108));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 5), 0.213256072141));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 6), 0.372456172519));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 7), 0.408268160057));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.752985306516));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 1), 0.972936747196));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 2), 0.0483774375986));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 3), 0.096648276834));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 4), 0.756069929567));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 5), 0.44789761169));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 6), 0.558090641318));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 7), 0.365642301604));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 0), 0.338632939335));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 1), 0.235820373685));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 2), 0.227415183528));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 3), 0.090845844464));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 4), 0.801360488075));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 5), 0.184335262651));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 6), 0.166577483436));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 7), 0.876580360468));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 0), 0.300903889795));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 1), 0.0824622426054));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 2), 0.57048477017));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 3), 0.581971805173));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 4), 0.43949517411));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 5), 0.21381802195));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 6), 0.846786664965));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 7), 0.286597816032));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 0), 0.987434811394));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 1), 0.351616737105));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 2), 0.922635050449));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 3), 0.967930776509));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 4), 0.177817746359));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 5), 0.189873869008));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 6), 0.464062150385));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 7), 0.333041773282));
        };
        unsafe {
            assert!(close(arr.get_unchecked(8, 0), 0.81780830653));
        };
        unsafe {
            assert!(close(arr.get_unchecked(8, 1), 0.492501643062));
        };
        unsafe {
            assert!(close(arr.get_unchecked(8, 2), 0.84632733488));
        };
        unsafe {
            assert!(close(arr.get_unchecked(8, 3), 0.800257416013));
        };
        unsafe {
            assert!(close(arr.get_unchecked(8, 4), 0.178537092654));
        };
        unsafe {
            assert!(close(arr.get_unchecked(8, 5), 0.380089876429));
        };
        unsafe {
            assert!(close(arr.get_unchecked(8, 6), 0.591937855112));
        };
        unsafe {
            assert!(close(arr.get_unchecked(8, 7), 0.630833632448));
        };
    }



    #[test]
    fn test_index_transpose_unsafe_4() {

        let mut arr = Array::from(vec![0.5053414095220631,
                                       0.9515944229974294,
                                       0.01869972616290927,
                                       0.3651095484212574,
                                       0.8093171436120703,
                                       0.9938563301832937,
                                       0.7758112569774406,
                                       0.46560288920814796,
                                       0.8620975137755558,
                                       0.17856062156157082,
                                       0.2541026841563959,
                                       0.07316076458101406,
                                       0.15855693769656998,
                                       0.9379247087641616,
                                       0.6889503228688164,
                                       0.11422222893176381,
                                       0.3136968489406069,
                                       0.3251977875790155,
                                       0.7135826937372265,
                                       0.7586005116188119,
                                       0.7254964300735486,
                                       0.8396463691221457,
                                       0.43328029656121825,
                                       0.3686468314958711,
                                       0.7397710935379666,
                                       0.4497911236174056,
                                       0.5277789783225971,
                                       0.22823121143029412,
                                       0.7205020351076907,
                                       0.2132560721407628,
                                       0.37245617251888463,
                                       0.40826816005663624,
                                       0.7529853065158498,
                                       0.9729367471961934,
                                       0.048377437598617234,
                                       0.09664827683400845,
                                       0.7560699295668065,
                                       0.4478976116896861,
                                       0.558090641317851,
                                       0.3656423016037962,
                                       0.33863293933524385,
                                       0.23582037368450148,
                                       0.22741518352824397,
                                       0.09084584446404942,
                                       0.8013604880752093,
                                       0.1843352626509892,
                                       0.1665774834355107,
                                       0.87658036046777,
                                       0.3009038897952965,
                                       0.08246224260539736,
                                       0.5704847701699387,
                                       0.5819718051730493,
                                       0.4394951741102917,
                                       0.21381802195045596,
                                       0.8467866649649154,
                                       0.2865978160316519,
                                       0.9874348113942802,
                                       0.35161673710515395,
                                       0.9226350504489396,
                                       0.9679307765092823,
                                       0.17781774635851644,
                                       0.18987386900845993,
                                       0.46406215038482046,
                                       0.33304177328203266,
                                       0.8178083065304194,
                                       0.492501643062211,
                                       0.8463273348799848,
                                       0.8002574160133654,
                                       0.17853709265446838,
                                       0.3800898764290961,
                                       0.591937855111794,
                                       0.6308336324475695]);
        arr.reshape(9, 8);

        let arr = arr.T();
        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.505341409522));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.951594422997));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.0186997261629));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.365109548421));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.809317143612));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 0), 0.993856330183));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 0), 0.775811256977));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 0), 0.465602889208));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.862097513776));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.178560621562));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.254102684156));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 1), 0.073160764581));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 1), 0.158556937697));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 1), 0.937924708764));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 1), 0.688950322869));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 1), 0.114222228932));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.313696848941));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.325197787579));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 2), 0.713582693737));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 2), 0.758600511619));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 2), 0.725496430074));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 2), 0.839646369122));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 2), 0.433280296561));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 2), 0.368646831496));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.739771093538));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 3), 0.449791123617));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 3), 0.527778978323));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 3), 0.22823121143));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 3), 0.720502035108));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 3), 0.213256072141));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 3), 0.372456172519));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 3), 0.408268160057));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.752985306516));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 4), 0.972936747196));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 4), 0.0483774375986));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 4), 0.096648276834));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 4), 0.756069929567));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 4), 0.44789761169));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 4), 0.558090641318));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 4), 0.365642301604));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 5), 0.338632939335));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 5), 0.235820373685));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 5), 0.227415183528));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 5), 0.090845844464));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 5), 0.801360488075));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 5), 0.184335262651));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 5), 0.166577483436));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 5), 0.876580360468));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 6), 0.300903889795));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 6), 0.0824622426054));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 6), 0.57048477017));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 6), 0.581971805173));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 6), 0.43949517411));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 6), 0.21381802195));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 6), 0.846786664965));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 6), 0.286597816032));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 7), 0.987434811394));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 7), 0.351616737105));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 7), 0.922635050449));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 7), 0.967930776509));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 7), 0.177817746359));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 7), 0.189873869008));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 7), 0.464062150385));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 7), 0.333041773282));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 8), 0.81780830653));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 8), 0.492501643062));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 8), 0.84632733488));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 8), 0.800257416013));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 8), 0.178537092654));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 8), 0.380089876429));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 8), 0.591937855112));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 8), 0.630833632448));
        };
    }



    #[test]
    fn test_index_5() {

        let mut arr = Array::from(vec![0.09152800621372814,
                                       0.1558614252975501,
                                       0.7802910977108659,
                                       0.28435944268744473,
                                       0.2960239682177843,
                                       0.9654803796310318,
                                       0.731031133492046,
                                       0.03883748361393946,
                                       0.015524690587036316,
                                       0.8712234607833866,
                                       0.8537783664660846,
                                       0.3106777819640948,
                                       0.7473480048614148,
                                       0.4319809610352656,
                                       0.31093699252150475,
                                       0.4998025835687895,
                                       0.6807904826516954,
                                       0.39650981304667443,
                                       0.7254553133137138,
                                       0.4275754465438585,
                                       0.5990890226697482]);
        arr.reshape(7, 3);

        assert!(close(arr.get(0, 0), 0.0915280062137));
        assert!(close(arr.get(0, 1), 0.155861425298));
        assert!(close(arr.get(0, 2), 0.780291097711));
        assert!(close(arr.get(1, 0), 0.284359442687));
        assert!(close(arr.get(1, 1), 0.296023968218));
        assert!(close(arr.get(1, 2), 0.965480379631));
        assert!(close(arr.get(2, 0), 0.731031133492));
        assert!(close(arr.get(2, 1), 0.0388374836139));
        assert!(close(arr.get(2, 2), 0.015524690587));
        assert!(close(arr.get(3, 0), 0.871223460783));
        assert!(close(arr.get(3, 1), 0.853778366466));
        assert!(close(arr.get(3, 2), 0.310677781964));
        assert!(close(arr.get(4, 0), 0.747348004861));
        assert!(close(arr.get(4, 1), 0.431980961035));
        assert!(close(arr.get(4, 2), 0.310936992522));
        assert!(close(arr.get(5, 0), 0.499802583569));
        assert!(close(arr.get(5, 1), 0.680790482652));
        assert!(close(arr.get(5, 2), 0.396509813047));
        assert!(close(arr.get(6, 0), 0.725455313314));
        assert!(close(arr.get(6, 1), 0.427575446544));
        assert!(close(arr.get(6, 2), 0.59908902267));
    }



    #[test]
    fn test_index_transpose_5() {

        let mut arr = Array::from(vec![0.09152800621372814,
                                       0.1558614252975501,
                                       0.7802910977108659,
                                       0.28435944268744473,
                                       0.2960239682177843,
                                       0.9654803796310318,
                                       0.731031133492046,
                                       0.03883748361393946,
                                       0.015524690587036316,
                                       0.8712234607833866,
                                       0.8537783664660846,
                                       0.3106777819640948,
                                       0.7473480048614148,
                                       0.4319809610352656,
                                       0.31093699252150475,
                                       0.4998025835687895,
                                       0.6807904826516954,
                                       0.39650981304667443,
                                       0.7254553133137138,
                                       0.4275754465438585,
                                       0.5990890226697482]);
        arr.reshape(7, 3);

        let arr = arr.T();
        assert!(close(arr.get(0, 0), 0.0915280062137));
        assert!(close(arr.get(1, 0), 0.155861425298));
        assert!(close(arr.get(2, 0), 0.780291097711));
        assert!(close(arr.get(0, 1), 0.284359442687));
        assert!(close(arr.get(1, 1), 0.296023968218));
        assert!(close(arr.get(2, 1), 0.965480379631));
        assert!(close(arr.get(0, 2), 0.731031133492));
        assert!(close(arr.get(1, 2), 0.0388374836139));
        assert!(close(arr.get(2, 2), 0.015524690587));
        assert!(close(arr.get(0, 3), 0.871223460783));
        assert!(close(arr.get(1, 3), 0.853778366466));
        assert!(close(arr.get(2, 3), 0.310677781964));
        assert!(close(arr.get(0, 4), 0.747348004861));
        assert!(close(arr.get(1, 4), 0.431980961035));
        assert!(close(arr.get(2, 4), 0.310936992522));
        assert!(close(arr.get(0, 5), 0.499802583569));
        assert!(close(arr.get(1, 5), 0.680790482652));
        assert!(close(arr.get(2, 5), 0.396509813047));
        assert!(close(arr.get(0, 6), 0.725455313314));
        assert!(close(arr.get(1, 6), 0.427575446544));
        assert!(close(arr.get(2, 6), 0.59908902267));
    }



    #[test]
    fn test_index_mut_5() {

        let mut arr = Array::from(vec![0.09152800621372814,
                                       0.1558614252975501,
                                       0.7802910977108659,
                                       0.28435944268744473,
                                       0.2960239682177843,
                                       0.9654803796310318,
                                       0.731031133492046,
                                       0.03883748361393946,
                                       0.015524690587036316,
                                       0.8712234607833866,
                                       0.8537783664660846,
                                       0.3106777819640948,
                                       0.7473480048614148,
                                       0.4319809610352656,
                                       0.31093699252150475,
                                       0.4998025835687895,
                                       0.6807904826516954,
                                       0.39650981304667443,
                                       0.7254553133137138,
                                       0.4275754465438585,
                                       0.5990890226697482]);
        arr.reshape(7, 3);

        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.09152800621));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.1558614253));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.78029109771));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.28435944269));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.29602396822));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.96548037963));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.73103113349));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.03883748361));
        let mut v = arr.get(2, 2);
        v += 1.0;
        assert!(close(v, 1.01552469059));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.87122346078));
        let mut v = arr.get(3, 1);
        v += 1.0;
        assert!(close(v, 1.85377836647));
        let mut v = arr.get(3, 2);
        v += 1.0;
        assert!(close(v, 1.31067778196));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.74734800486));
        let mut v = arr.get(4, 1);
        v += 1.0;
        assert!(close(v, 1.43198096104));
        let mut v = arr.get(4, 2);
        v += 1.0;
        assert!(close(v, 1.31093699252));
        let mut v = arr.get(5, 0);
        v += 1.0;
        assert!(close(v, 1.49980258357));
        let mut v = arr.get(5, 1);
        v += 1.0;
        assert!(close(v, 1.68079048265));
        let mut v = arr.get(5, 2);
        v += 1.0;
        assert!(close(v, 1.39650981305));
        let mut v = arr.get(6, 0);
        v += 1.0;
        assert!(close(v, 1.72545531331));
        let mut v = arr.get(6, 1);
        v += 1.0;
        assert!(close(v, 1.42757544654));
        let mut v = arr.get(6, 2);
        v += 1.0;
        assert!(close(v, 1.59908902267));
    }



    #[test]
    fn test_index_transpose_mut_5() {

        let mut arr = Array::from(vec![0.09152800621372814,
                                       0.1558614252975501,
                                       0.7802910977108659,
                                       0.28435944268744473,
                                       0.2960239682177843,
                                       0.9654803796310318,
                                       0.731031133492046,
                                       0.03883748361393946,
                                       0.015524690587036316,
                                       0.8712234607833866,
                                       0.8537783664660846,
                                       0.3106777819640948,
                                       0.7473480048614148,
                                       0.4319809610352656,
                                       0.31093699252150475,
                                       0.4998025835687895,
                                       0.6807904826516954,
                                       0.39650981304667443,
                                       0.7254553133137138,
                                       0.4275754465438585,
                                       0.5990890226697482]);
        arr.reshape(7, 3);

        let arr = arr.T();
        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.09152800621));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.1558614253));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.78029109771));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.28435944269));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.29602396822));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.96548037963));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.73103113349));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.03883748361));
        let mut v = arr.get(2, 2);
        v += 1.0;
        assert!(close(v, 1.01552469059));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.87122346078));
        let mut v = arr.get(1, 3);
        v += 1.0;
        assert!(close(v, 1.85377836647));
        let mut v = arr.get(2, 3);
        v += 1.0;
        assert!(close(v, 1.31067778196));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.74734800486));
        let mut v = arr.get(1, 4);
        v += 1.0;
        assert!(close(v, 1.43198096104));
        let mut v = arr.get(2, 4);
        v += 1.0;
        assert!(close(v, 1.31093699252));
        let mut v = arr.get(0, 5);
        v += 1.0;
        assert!(close(v, 1.49980258357));
        let mut v = arr.get(1, 5);
        v += 1.0;
        assert!(close(v, 1.68079048265));
        let mut v = arr.get(2, 5);
        v += 1.0;
        assert!(close(v, 1.39650981305));
        let mut v = arr.get(0, 6);
        v += 1.0;
        assert!(close(v, 1.72545531331));
        let mut v = arr.get(1, 6);
        v += 1.0;
        assert!(close(v, 1.42757544654));
        let mut v = arr.get(2, 6);
        v += 1.0;
        assert!(close(v, 1.59908902267));
    }



    #[test]
    fn test_index_unsafe_5() {

        let mut arr = Array::from(vec![0.09152800621372814,
                                       0.1558614252975501,
                                       0.7802910977108659,
                                       0.28435944268744473,
                                       0.2960239682177843,
                                       0.9654803796310318,
                                       0.731031133492046,
                                       0.03883748361393946,
                                       0.015524690587036316,
                                       0.8712234607833866,
                                       0.8537783664660846,
                                       0.3106777819640948,
                                       0.7473480048614148,
                                       0.4319809610352656,
                                       0.31093699252150475,
                                       0.4998025835687895,
                                       0.6807904826516954,
                                       0.39650981304667443,
                                       0.7254553133137138,
                                       0.4275754465438585,
                                       0.5990890226697482]);
        arr.reshape(7, 3);

        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.0915280062137));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.155861425298));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.780291097711));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.284359442687));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.296023968218));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.965480379631));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.731031133492));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.0388374836139));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 2), 0.015524690587));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.871223460783));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 1), 0.853778366466));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 2), 0.310677781964));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.747348004861));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 1), 0.431980961035));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 2), 0.310936992522));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 0), 0.499802583569));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 1), 0.680790482652));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 2), 0.396509813047));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 0), 0.725455313314));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 1), 0.427575446544));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 2), 0.59908902267));
        };
    }



    #[test]
    fn test_index_transpose_unsafe_5() {

        let mut arr = Array::from(vec![0.09152800621372814,
                                       0.1558614252975501,
                                       0.7802910977108659,
                                       0.28435944268744473,
                                       0.2960239682177843,
                                       0.9654803796310318,
                                       0.731031133492046,
                                       0.03883748361393946,
                                       0.015524690587036316,
                                       0.8712234607833866,
                                       0.8537783664660846,
                                       0.3106777819640948,
                                       0.7473480048614148,
                                       0.4319809610352656,
                                       0.31093699252150475,
                                       0.4998025835687895,
                                       0.6807904826516954,
                                       0.39650981304667443,
                                       0.7254553133137138,
                                       0.4275754465438585,
                                       0.5990890226697482]);
        arr.reshape(7, 3);

        let arr = arr.T();
        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.0915280062137));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.155861425298));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.780291097711));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.284359442687));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.296023968218));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.965480379631));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.731031133492));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.0388374836139));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 2), 0.015524690587));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.871223460783));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 3), 0.853778366466));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 3), 0.310677781964));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.747348004861));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 4), 0.431980961035));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 4), 0.310936992522));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 5), 0.499802583569));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 5), 0.680790482652));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 5), 0.396509813047));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 6), 0.725455313314));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 6), 0.427575446544));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 6), 0.59908902267));
        };
    }



    #[test]
    fn test_index_6() {

        let mut arr = Array::from(vec![0.1997387179767336]);
        arr.reshape(1, 1);

        assert!(close(arr.get(0, 0), 0.199738717977));
    }



    #[test]
    fn test_index_transpose_6() {

        let mut arr = Array::from(vec![0.1997387179767336]);
        arr.reshape(1, 1);

        let arr = arr.T();
        assert!(close(arr.get(0, 0), 0.199738717977));
    }



    #[test]
    fn test_index_mut_6() {

        let mut arr = Array::from(vec![0.1997387179767336]);
        arr.reshape(1, 1);

        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.19973871798));
    }



    #[test]
    fn test_index_transpose_mut_6() {

        let mut arr = Array::from(vec![0.1997387179767336]);
        arr.reshape(1, 1);

        let arr = arr.T();
        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.19973871798));
    }



    #[test]
    fn test_index_unsafe_6() {

        let mut arr = Array::from(vec![0.1997387179767336]);
        arr.reshape(1, 1);

        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.199738717977));
        };
    }



    #[test]
    fn test_index_transpose_unsafe_6() {

        let mut arr = Array::from(vec![0.1997387179767336]);
        arr.reshape(1, 1);

        let arr = arr.T();
        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.199738717977));
        };
    }



    #[test]
    fn test_index_7() {

        let mut arr = Array::from(vec![0.7290688662070789,
                                       0.10701545300146353,
                                       0.8133094795587649,
                                       0.7727568754312601,
                                       0.058066140581452874,
                                       0.1406388640685593,
                                       0.6369940029688143,
                                       0.37915658124608276,
                                       0.2840350156111312,
                                       0.36249068359756387,
                                       0.2842751827925457,
                                       0.8852568677946027,
                                       0.9392662970818118,
                                       0.7232943243389232,
                                       0.520528368063512,
                                       0.7363552471090443]);
        arr.reshape(2, 8);

        assert!(close(arr.get(0, 0), 0.729068866207));
        assert!(close(arr.get(0, 1), 0.107015453001));
        assert!(close(arr.get(0, 2), 0.813309479559));
        assert!(close(arr.get(0, 3), 0.772756875431));
        assert!(close(arr.get(0, 4), 0.0580661405815));
        assert!(close(arr.get(0, 5), 0.140638864069));
        assert!(close(arr.get(0, 6), 0.636994002969));
        assert!(close(arr.get(0, 7), 0.379156581246));
        assert!(close(arr.get(1, 0), 0.284035015611));
        assert!(close(arr.get(1, 1), 0.362490683598));
        assert!(close(arr.get(1, 2), 0.284275182793));
        assert!(close(arr.get(1, 3), 0.885256867795));
        assert!(close(arr.get(1, 4), 0.939266297082));
        assert!(close(arr.get(1, 5), 0.723294324339));
        assert!(close(arr.get(1, 6), 0.520528368064));
        assert!(close(arr.get(1, 7), 0.736355247109));
    }



    #[test]
    fn test_index_transpose_7() {

        let mut arr = Array::from(vec![0.7290688662070789,
                                       0.10701545300146353,
                                       0.8133094795587649,
                                       0.7727568754312601,
                                       0.058066140581452874,
                                       0.1406388640685593,
                                       0.6369940029688143,
                                       0.37915658124608276,
                                       0.2840350156111312,
                                       0.36249068359756387,
                                       0.2842751827925457,
                                       0.8852568677946027,
                                       0.9392662970818118,
                                       0.7232943243389232,
                                       0.520528368063512,
                                       0.7363552471090443]);
        arr.reshape(2, 8);

        let arr = arr.T();
        assert!(close(arr.get(0, 0), 0.729068866207));
        assert!(close(arr.get(1, 0), 0.107015453001));
        assert!(close(arr.get(2, 0), 0.813309479559));
        assert!(close(arr.get(3, 0), 0.772756875431));
        assert!(close(arr.get(4, 0), 0.0580661405815));
        assert!(close(arr.get(5, 0), 0.140638864069));
        assert!(close(arr.get(6, 0), 0.636994002969));
        assert!(close(arr.get(7, 0), 0.379156581246));
        assert!(close(arr.get(0, 1), 0.284035015611));
        assert!(close(arr.get(1, 1), 0.362490683598));
        assert!(close(arr.get(2, 1), 0.284275182793));
        assert!(close(arr.get(3, 1), 0.885256867795));
        assert!(close(arr.get(4, 1), 0.939266297082));
        assert!(close(arr.get(5, 1), 0.723294324339));
        assert!(close(arr.get(6, 1), 0.520528368064));
        assert!(close(arr.get(7, 1), 0.736355247109));
    }



    #[test]
    fn test_index_mut_7() {

        let mut arr = Array::from(vec![0.7290688662070789,
                                       0.10701545300146353,
                                       0.8133094795587649,
                                       0.7727568754312601,
                                       0.058066140581452874,
                                       0.1406388640685593,
                                       0.6369940029688143,
                                       0.37915658124608276,
                                       0.2840350156111312,
                                       0.36249068359756387,
                                       0.2842751827925457,
                                       0.8852568677946027,
                                       0.9392662970818118,
                                       0.7232943243389232,
                                       0.520528368063512,
                                       0.7363552471090443]);
        arr.reshape(2, 8);

        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.72906886621));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.107015453));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.81330947956));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.77275687543));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.05806614058));
        let mut v = arr.get(0, 5);
        v += 1.0;
        assert!(close(v, 1.14063886407));
        let mut v = arr.get(0, 6);
        v += 1.0;
        assert!(close(v, 1.63699400297));
        let mut v = arr.get(0, 7);
        v += 1.0;
        assert!(close(v, 1.37915658125));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.28403501561));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.3624906836));
        let mut v = arr.get(1, 2);
        v += 1.0;
        assert!(close(v, 1.28427518279));
        let mut v = arr.get(1, 3);
        v += 1.0;
        assert!(close(v, 1.88525686779));
        let mut v = arr.get(1, 4);
        v += 1.0;
        assert!(close(v, 1.93926629708));
        let mut v = arr.get(1, 5);
        v += 1.0;
        assert!(close(v, 1.72329432434));
        let mut v = arr.get(1, 6);
        v += 1.0;
        assert!(close(v, 1.52052836806));
        let mut v = arr.get(1, 7);
        v += 1.0;
        assert!(close(v, 1.73635524711));
    }



    #[test]
    fn test_index_transpose_mut_7() {

        let mut arr = Array::from(vec![0.7290688662070789,
                                       0.10701545300146353,
                                       0.8133094795587649,
                                       0.7727568754312601,
                                       0.058066140581452874,
                                       0.1406388640685593,
                                       0.6369940029688143,
                                       0.37915658124608276,
                                       0.2840350156111312,
                                       0.36249068359756387,
                                       0.2842751827925457,
                                       0.8852568677946027,
                                       0.9392662970818118,
                                       0.7232943243389232,
                                       0.520528368063512,
                                       0.7363552471090443]);
        arr.reshape(2, 8);

        let arr = arr.T();
        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.72906886621));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.107015453));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.81330947956));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.77275687543));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.05806614058));
        let mut v = arr.get(5, 0);
        v += 1.0;
        assert!(close(v, 1.14063886407));
        let mut v = arr.get(6, 0);
        v += 1.0;
        assert!(close(v, 1.63699400297));
        let mut v = arr.get(7, 0);
        v += 1.0;
        assert!(close(v, 1.37915658125));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.28403501561));
        let mut v = arr.get(1, 1);
        v += 1.0;
        assert!(close(v, 1.3624906836));
        let mut v = arr.get(2, 1);
        v += 1.0;
        assert!(close(v, 1.28427518279));
        let mut v = arr.get(3, 1);
        v += 1.0;
        assert!(close(v, 1.88525686779));
        let mut v = arr.get(4, 1);
        v += 1.0;
        assert!(close(v, 1.93926629708));
        let mut v = arr.get(5, 1);
        v += 1.0;
        assert!(close(v, 1.72329432434));
        let mut v = arr.get(6, 1);
        v += 1.0;
        assert!(close(v, 1.52052836806));
        let mut v = arr.get(7, 1);
        v += 1.0;
        assert!(close(v, 1.73635524711));
    }



    #[test]
    fn test_index_unsafe_7() {

        let mut arr = Array::from(vec![0.7290688662070789,
                                       0.10701545300146353,
                                       0.8133094795587649,
                                       0.7727568754312601,
                                       0.058066140581452874,
                                       0.1406388640685593,
                                       0.6369940029688143,
                                       0.37915658124608276,
                                       0.2840350156111312,
                                       0.36249068359756387,
                                       0.2842751827925457,
                                       0.8852568677946027,
                                       0.9392662970818118,
                                       0.7232943243389232,
                                       0.520528368063512,
                                       0.7363552471090443]);
        arr.reshape(2, 8);

        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.729068866207));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.107015453001));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.813309479559));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.772756875431));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.0580661405815));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 5), 0.140638864069));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 6), 0.636994002969));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 7), 0.379156581246));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.284035015611));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.362490683598));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 2), 0.284275182793));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 3), 0.885256867795));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 4), 0.939266297082));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 5), 0.723294324339));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 6), 0.520528368064));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 7), 0.736355247109));
        };
    }



    #[test]
    fn test_index_transpose_unsafe_7() {

        let mut arr = Array::from(vec![0.7290688662070789,
                                       0.10701545300146353,
                                       0.8133094795587649,
                                       0.7727568754312601,
                                       0.058066140581452874,
                                       0.1406388640685593,
                                       0.6369940029688143,
                                       0.37915658124608276,
                                       0.2840350156111312,
                                       0.36249068359756387,
                                       0.2842751827925457,
                                       0.8852568677946027,
                                       0.9392662970818118,
                                       0.7232943243389232,
                                       0.520528368063512,
                                       0.7363552471090443]);
        arr.reshape(2, 8);

        let arr = arr.T();
        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.729068866207));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.107015453001));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.813309479559));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.772756875431));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.0580661405815));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 0), 0.140638864069));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 0), 0.636994002969));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 0), 0.379156581246));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.284035015611));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 1), 0.362490683598));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 1), 0.284275182793));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 1), 0.885256867795));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 1), 0.939266297082));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 1), 0.723294324339));
        };
        unsafe {
            assert!(close(arr.get_unchecked(6, 1), 0.520528368064));
        };
        unsafe {
            assert!(close(arr.get_unchecked(7, 1), 0.736355247109));
        };
    }



    #[test]
    fn test_index_8() {

        let mut arr = Array::from(vec![0.07063263155528676,
                                       0.12404813469596765,
                                       0.11003071509029239,
                                       0.2307718142908437,
                                       0.872667486390751]);
        arr.reshape(1, 5);

        assert!(close(arr.get(0, 0), 0.0706326315553));
        assert!(close(arr.get(0, 1), 0.124048134696));
        assert!(close(arr.get(0, 2), 0.11003071509));
        assert!(close(arr.get(0, 3), 0.230771814291));
        assert!(close(arr.get(0, 4), 0.872667486391));
    }



    #[test]
    fn test_index_transpose_8() {

        let mut arr = Array::from(vec![0.07063263155528676,
                                       0.12404813469596765,
                                       0.11003071509029239,
                                       0.2307718142908437,
                                       0.872667486390751]);
        arr.reshape(1, 5);

        let arr = arr.T();
        assert!(close(arr.get(0, 0), 0.0706326315553));
        assert!(close(arr.get(1, 0), 0.124048134696));
        assert!(close(arr.get(2, 0), 0.11003071509));
        assert!(close(arr.get(3, 0), 0.230771814291));
        assert!(close(arr.get(4, 0), 0.872667486391));
    }



    #[test]
    fn test_index_mut_8() {

        let mut arr = Array::from(vec![0.07063263155528676,
                                       0.12404813469596765,
                                       0.11003071509029239,
                                       0.2307718142908437,
                                       0.872667486390751]);
        arr.reshape(1, 5);

        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.07063263156));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.1240481347));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.11003071509));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.23077181429));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.87266748639));
    }



    #[test]
    fn test_index_transpose_mut_8() {

        let mut arr = Array::from(vec![0.07063263155528676,
                                       0.12404813469596765,
                                       0.11003071509029239,
                                       0.2307718142908437,
                                       0.872667486390751]);
        arr.reshape(1, 5);

        let arr = arr.T();
        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.07063263156));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.1240481347));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.11003071509));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.23077181429));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.87266748639));
    }



    #[test]
    fn test_index_unsafe_8() {

        let mut arr = Array::from(vec![0.07063263155528676,
                                       0.12404813469596765,
                                       0.11003071509029239,
                                       0.2307718142908437,
                                       0.872667486390751]);
        arr.reshape(1, 5);

        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.0706326315553));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.124048134696));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.11003071509));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.230771814291));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.872667486391));
        };
    }



    #[test]
    fn test_index_transpose_unsafe_8() {

        let mut arr = Array::from(vec![0.07063263155528676,
                                       0.12404813469596765,
                                       0.11003071509029239,
                                       0.2307718142908437,
                                       0.872667486390751]);
        arr.reshape(1, 5);

        let arr = arr.T();
        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.0706326315553));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.124048134696));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.11003071509));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.230771814291));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.872667486391));
        };
    }



    #[test]
    fn test_index_9() {

        let mut arr = Array::from(vec![0.8838213961957216,
                                       0.7310938683329141,
                                       0.591505339227943,
                                       0.3930296867058841,
                                       0.27046020836139695,
                                       0.9695271560912553]);
        arr.reshape(1, 6);

        assert!(close(arr.get(0, 0), 0.883821396196));
        assert!(close(arr.get(0, 1), 0.731093868333));
        assert!(close(arr.get(0, 2), 0.591505339228));
        assert!(close(arr.get(0, 3), 0.393029686706));
        assert!(close(arr.get(0, 4), 0.270460208361));
        assert!(close(arr.get(0, 5), 0.969527156091));
    }



    #[test]
    fn test_index_transpose_9() {

        let mut arr = Array::from(vec![0.8838213961957216,
                                       0.7310938683329141,
                                       0.591505339227943,
                                       0.3930296867058841,
                                       0.27046020836139695,
                                       0.9695271560912553]);
        arr.reshape(1, 6);

        let arr = arr.T();
        assert!(close(arr.get(0, 0), 0.883821396196));
        assert!(close(arr.get(1, 0), 0.731093868333));
        assert!(close(arr.get(2, 0), 0.591505339228));
        assert!(close(arr.get(3, 0), 0.393029686706));
        assert!(close(arr.get(4, 0), 0.270460208361));
        assert!(close(arr.get(5, 0), 0.969527156091));
    }



    #[test]
    fn test_index_mut_9() {

        let mut arr = Array::from(vec![0.8838213961957216,
                                       0.7310938683329141,
                                       0.591505339227943,
                                       0.3930296867058841,
                                       0.27046020836139695,
                                       0.9695271560912553]);
        arr.reshape(1, 6);

        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.8838213962));
        let mut v = arr.get(0, 1);
        v += 1.0;
        assert!(close(v, 1.73109386833));
        let mut v = arr.get(0, 2);
        v += 1.0;
        assert!(close(v, 1.59150533923));
        let mut v = arr.get(0, 3);
        v += 1.0;
        assert!(close(v, 1.39302968671));
        let mut v = arr.get(0, 4);
        v += 1.0;
        assert!(close(v, 1.27046020836));
        let mut v = arr.get(0, 5);
        v += 1.0;
        assert!(close(v, 1.96952715609));
    }



    #[test]
    fn test_index_transpose_mut_9() {

        let mut arr = Array::from(vec![0.8838213961957216,
                                       0.7310938683329141,
                                       0.591505339227943,
                                       0.3930296867058841,
                                       0.27046020836139695,
                                       0.9695271560912553]);
        arr.reshape(1, 6);

        let arr = arr.T();
        let mut v = arr.get(0, 0);
        v += 1.0;
        assert!(close(v, 1.8838213962));
        let mut v = arr.get(1, 0);
        v += 1.0;
        assert!(close(v, 1.73109386833));
        let mut v = arr.get(2, 0);
        v += 1.0;
        assert!(close(v, 1.59150533923));
        let mut v = arr.get(3, 0);
        v += 1.0;
        assert!(close(v, 1.39302968671));
        let mut v = arr.get(4, 0);
        v += 1.0;
        assert!(close(v, 1.27046020836));
        let mut v = arr.get(5, 0);
        v += 1.0;
        assert!(close(v, 1.96952715609));
    }



    #[test]
    fn test_index_unsafe_9() {

        let mut arr = Array::from(vec![0.8838213961957216,
                                       0.7310938683329141,
                                       0.591505339227943,
                                       0.3930296867058841,
                                       0.27046020836139695,
                                       0.9695271560912553]);
        arr.reshape(1, 6);

        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.883821396196));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 1), 0.731093868333));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 2), 0.591505339228));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 3), 0.393029686706));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 4), 0.270460208361));
        };
        unsafe {
            assert!(close(arr.get_unchecked(0, 5), 0.969527156091));
        };
    }



    #[test]
    fn test_index_transpose_unsafe_9() {

        let mut arr = Array::from(vec![0.8838213961957216,
                                       0.7310938683329141,
                                       0.591505339227943,
                                       0.3930296867058841,
                                       0.27046020836139695,
                                       0.9695271560912553]);
        arr.reshape(1, 6);

        let arr = arr.T();
        unsafe {
            assert!(close(arr.get_unchecked(0, 0), 0.883821396196));
        };
        unsafe {
            assert!(close(arr.get_unchecked(1, 0), 0.731093868333));
        };
        unsafe {
            assert!(close(arr.get_unchecked(2, 0), 0.591505339228));
        };
        unsafe {
            assert!(close(arr.get_unchecked(3, 0), 0.393029686706));
        };
        unsafe {
            assert!(close(arr.get_unchecked(4, 0), 0.270460208361));
        };
        unsafe {
            assert!(close(arr.get_unchecked(5, 0), 0.969527156091));
        };
    }



    #[test]
    fn test_scalar_get_rows_0() {

        let mut arr = Array::from(vec![0.3722480632739109,
                                       0.48249797217655366,
                                       0.5820075840726694,
                                       0.12173900162762719,
                                       0.3539321652146755,
                                       0.1850050587355847,
                                       0.8609992285586576]);
        arr.reshape(1, 7);

        let mut result = Array::from(vec![0.3722480632739109,
                                          0.48249797217655366,
                                          0.5820075840726694,
                                          0.12173900162762719,
                                          0.3539321652146755,
                                          0.1850050587355847,
                                          0.8609992285586576]);
        result.reshape(1, 7);

        let idx: usize = 0;

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_1() {

        let mut arr = Array::from(vec![0.16670442758124215,
                                       0.9809173509734783,
                                       0.5219543568353495,
                                       0.7688874271143169,
                                       0.33020029888139446,
                                       0.9140498832450512,
                                       0.8937884622689195,
                                       0.9992433283863036,
                                       0.3557146765666962,
                                       0.14757544764625197,
                                       0.4938452726563023,
                                       0.1399278194103637,
                                       0.13894021778041787,
                                       0.10644549909602319,
                                       0.11332534418104068,
                                       0.6330836000967018]);
        arr.reshape(4, 4);

        let mut result = Array::from(vec![0.13894021778041787,
                                          0.10644549909602319,
                                          0.11332534418104068,
                                          0.6330836000967018]);
        result.reshape(1, 4);

        let idx: usize = 3;

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_2() {

        let mut arr = Array::from(vec![0.26989012057050243,
                                       0.19514630721957138,
                                       0.9087828287867478,
                                       0.7073279384566468,
                                       0.8670738434351174,
                                       0.20551684587161345,
                                       0.23736843669262042,
                                       0.8825217634984357,
                                       0.9967793452074264,
                                       0.9607407952348515,
                                       0.5016280907924334,
                                       0.3863801399925716,
                                       0.40457003033682537,
                                       0.7568353115420497,
                                       0.23408554719273722,
                                       0.7778764933399568]);
        arr.reshape(8, 2);

        let mut result = Array::from(vec![0.9087828287867478, 0.7073279384566468]);
        result.reshape(1, 2);

        let idx: usize = 1;

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_3() {

        let mut arr = Array::from(vec![0.5844832321191438,
                                       0.4503348688179716,
                                       0.13646171935781248,
                                       0.8044103204618683,
                                       0.014390653665222297,
                                       0.2191313304598439,
                                       0.6137879456561219,
                                       0.9673146277449449,
                                       0.9094277994690535,
                                       0.923587539666623,
                                       0.6570233338121578,
                                       0.18803787926140947]);
        arr.reshape(4, 3);

        let mut result =
            Array::from(vec![0.8044103204618683, 0.014390653665222297, 0.2191313304598439]);
        result.reshape(1, 3);

        let idx: usize = 1;

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_4() {

        let mut arr = Array::from(vec![0.2397046682128683,
                                       0.12059059016191787,
                                       0.4400190962098014,
                                       0.7821202495865915,
                                       0.43502082593671665,
                                       0.8710523086890986,
                                       0.27462666577600936,
                                       0.4737198628516651,
                                       0.779403312554097,
                                       0.8497818487077968,
                                       0.4585144543444213,
                                       0.6566950512254239,
                                       0.7714250944269657,
                                       0.629090962649588,
                                       0.20490665514239403,
                                       0.8472739199350465,
                                       0.8382349609471311,
                                       0.41058660070453323,
                                       0.6627993636988255,
                                       0.4272446641429759,
                                       0.5790230468688655,
                                       0.5194114756785692,
                                       0.13428662473013508,
                                       0.9410554241236381,
                                       0.22547806367281786,
                                       0.8831624935411332,
                                       0.2428643127508242,
                                       0.23826687309168026,
                                       0.6908727281613396,
                                       0.8711031906585175,
                                       0.17951077959070694,
                                       0.45117215797109533,
                                       0.1864955345396303,
                                       0.9834791816066387,
                                       0.48963697623625646,
                                       0.8287057473069219,
                                       0.3838953307927665,
                                       0.053125704439537236,
                                       0.29116373677210794,
                                       0.941779753628731,
                                       0.013885558608201398,
                                       0.6695737944604466,
                                       0.9767080260738779,
                                       0.3905862231789099,
                                       0.3140191121443441,
                                       0.24744334004685142,
                                       0.394621332891979,
                                       0.15634518603333325,
                                       0.3205295548163746,
                                       0.5068037073961843,
                                       0.47478726211958033,
                                       0.6019871405304179,
                                       0.8206113642862755,
                                       0.3086874205021116]);
        arr.reshape(9, 6);

        let mut result = Array::from(vec![0.2397046682128683,
                                          0.12059059016191787,
                                          0.4400190962098014,
                                          0.7821202495865915,
                                          0.43502082593671665,
                                          0.8710523086890986]);
        result.reshape(1, 6);

        let idx: usize = 0;

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_5() {

        let mut arr = Array::from(vec![0.49632664377337465,
                                       0.3719845767674499,
                                       0.37053512307586267,
                                       0.3063503408877194,
                                       0.4222632051696087]);
        arr.reshape(5, 1);

        let mut result = Array::from(vec![0.4222632051696087]);
        result.reshape(1, 1);

        let idx: usize = 4;

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_6() {

        let mut arr = Array::from(vec![0.2579576201021455,
                                       0.5187867882127396,
                                       0.19431182767596933,
                                       0.4853530731493949,
                                       0.5800636798501165,
                                       0.5935396495668448,
                                       0.7818523710669958,
                                       0.6132598583687154,
                                       0.6494647210287537,
                                       0.5815011751052933,
                                       0.36488424933613706,
                                       0.19940341495893144,
                                       0.6430731579879294,
                                       0.2231986815293715,
                                       0.5794192953806522,
                                       0.8491681513249606,
                                       0.5590567778062495,
                                       0.16413498179673358]);
        arr.reshape(3, 6);

        let mut result = Array::from(vec![0.6430731579879294,
                                          0.2231986815293715,
                                          0.5794192953806522,
                                          0.8491681513249606,
                                          0.5590567778062495,
                                          0.16413498179673358]);
        result.reshape(1, 6);

        let idx: usize = 2;

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_7() {

        let mut arr = Array::from(vec![0.0003004822330865409,
                                       0.599644854758037,
                                       0.9066722654745323,
                                       0.12616649234955135,
                                       0.2534106622805612,
                                       0.9164076040760916,
                                       0.20340819793158404,
                                       0.7320736399666427,
                                       0.5683945013977814,
                                       0.23072766845419346,
                                       0.7938839212240894,
                                       0.47344349796693097,
                                       0.8383480152551277,
                                       0.48575519261064704,
                                       0.7853055020747374,
                                       0.40113284411194683,
                                       0.8482045983316658,
                                       0.7943761574061883,
                                       0.470393509932051,
                                       0.13830664250813218,
                                       0.015439826684317759,
                                       0.5608858777071175,
                                       0.1771614502126876,
                                       0.7044040681265694,
                                       0.09777558221533078,
                                       0.21432627220156175,
                                       0.07768823652706491,
                                       0.6298968348041116,
                                       0.5068347570793338,
                                       0.8804620017635494,
                                       0.9712860082615138,
                                       0.17783419253812272,
                                       0.5936442286236709,
                                       0.8849029635338052,
                                       0.9698629174778053,
                                       0.867364503753128,
                                       0.29225868007766787,
                                       0.8942658646465623,
                                       0.3302812009351821,
                                       0.6424149581009345,
                                       0.7006204805735523,
                                       0.061902304150032506,
                                       0.13803559152972933,
                                       0.3442386295139299,
                                       0.19841689104524585,
                                       0.030700064583753628,
                                       0.9033796569089796,
                                       0.27420842487171393,
                                       0.5110210625290373]);
        arr.reshape(7, 7);

        let mut result = Array::from(vec![0.5068347570793338,
                                          0.8804620017635494,
                                          0.9712860082615138,
                                          0.17783419253812272,
                                          0.5936442286236709,
                                          0.8849029635338052,
                                          0.9698629174778053]);
        result.reshape(1, 7);

        let idx: usize = 4;

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_8() {

        let mut arr = Array::from(vec![0.931526619904902,
                                       0.28768586515767547,
                                       0.7414423543862344,
                                       0.4062206036800229,
                                       0.2557090044121624,
                                       0.6404601813355759,
                                       0.03727392470604762,
                                       0.5473945412299315,
                                       0.9650248941651993,
                                       0.6874838609580888,
                                       0.27640726332886334,
                                       0.9906692306763057,
                                       0.809775187614569,
                                       0.005625003712199317,
                                       0.7514209327286175,
                                       0.7704877295307784,
                                       0.4049076312518529,
                                       0.7781298308142054,
                                       0.8169347786156945,
                                       0.13463958039956947,
                                       0.06395392493747731,
                                       0.8362206409319478,
                                       0.11603620710083096,
                                       0.708130338663838,
                                       0.4552777547181637,
                                       0.9371679662979221,
                                       0.4820369439007033,
                                       0.48165707398977875,
                                       0.6823571469673899,
                                       0.3811314781909264,
                                       0.6362682433519532,
                                       0.8706117127113122,
                                       0.3738584026965758,
                                       0.03855252280591348,
                                       0.2507708970035266,
                                       0.870001531720022,
                                       0.6412087161983915,
                                       0.6211277966332598,
                                       0.34025327585085585,
                                       0.7977161831745702,
                                       0.29715686603486524,
                                       0.045924417571815646]);
        arr.reshape(7, 6);

        let mut result = Array::from(vec![0.809775187614569,
                                          0.005625003712199317,
                                          0.7514209327286175,
                                          0.7704877295307784,
                                          0.4049076312518529,
                                          0.7781298308142054]);
        result.reshape(1, 6);

        let idx: usize = 2;

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_9() {

        let mut arr = Array::from(vec![0.20868550871724179,
                                       0.5605127695203469,
                                       0.339804058118506,
                                       0.7256905381163948,
                                       0.6611417510563221,
                                       0.969019548886142,
                                       0.8471190899730158,
                                       0.4380513125992891,
                                       0.8646212553805457,
                                       0.6487929773201981,
                                       0.6937440457173739,
                                       0.9679474559715064,
                                       0.24340259978189238,
                                       0.7870005431727255,
                                       0.6427913578996599,
                                       0.6660887992362555,
                                       0.40442105665544525,
                                       0.12523251977686645,
                                       0.837216006531832,
                                       0.16563066983169672,
                                       0.6202657886890243,
                                       0.5242136939252772,
                                       0.35801788839394355,
                                       0.11278053040947844]);
        arr.reshape(6, 4);

        let mut result = Array::from(vec![0.40442105665544525,
                                          0.12523251977686645,
                                          0.837216006531832,
                                          0.16563066983169672]);
        result.reshape(1, 4);

        let idx: usize = 4;

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_transpose_0() {

        let mut arr = Array::from(vec![0.7707843100914994,
                                       0.25091438495265406,
                                       0.8799693575880421,
                                       0.28563785932012686,
                                       0.697387193772135,
                                       0.5745064605630149,
                                       0.3904684326376954,
                                       0.28571568506794665,
                                       0.19545894929132046,
                                       0.6664775490939762,
                                       0.8209682309863416,
                                       0.3129695667863188,
                                       0.28191295400607375,
                                       0.18339346264137957,
                                       0.8465732304205962,
                                       0.9730523995670246,
                                       0.2109218243532145,
                                       0.49922436813494864]);
        arr.reshape(3, 6);
        arr = arr.T();

        let mut result =
            Array::from(vec![0.5745064605630149, 0.3129695667863188, 0.49922436813494864]);
        result.reshape(1, 3);

        let idx: usize = 5;

        assert!(result.rows() == arr.get_rows(&idx).rows());
        assert!(result.cols() == arr.get_rows(&idx).cols());

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_transpose_1() {

        let mut arr = Array::from(vec![0.8594613111600163,
                                       0.14690297325717538,
                                       0.36217549328710164,
                                       0.6272167734212485,
                                       0.9673960754471982,
                                       0.2802010597596365,
                                       0.6460370890906921,
                                       0.43445879437479584,
                                       0.36081982771335175,
                                       0.44704186652259914,
                                       0.9154543840398504,
                                       0.3032997978422961,
                                       0.30700592101137414,
                                       0.886361245126547,
                                       0.19701898755505798]);
        arr.reshape(3, 5);
        arr = arr.T();

        let mut result =
            Array::from(vec![0.36217549328710164, 0.43445879437479584, 0.30700592101137414]);
        result.reshape(1, 3);

        let idx: usize = 2;

        assert!(result.rows() == arr.get_rows(&idx).rows());
        assert!(result.cols() == arr.get_rows(&idx).cols());

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_transpose_2() {

        let mut arr = Array::from(vec![0.9541227305606255,
                                       0.6436514862833917,
                                       0.05859880017805563,
                                       0.23740708112108921,
                                       0.6072948457117148,
                                       0.5153597444844064,
                                       0.7587734480095167,
                                       0.23496117804708339,
                                       0.7771437499400726,
                                       0.7706168427008873,
                                       0.43584816639713464,
                                       0.703954723101276,
                                       0.9577244694951818,
                                       0.7946375870867021,
                                       0.10922041808660654,
                                       0.819411678218866,
                                       0.6355308938638995,
                                       0.06877967645041005,
                                       0.3811764684296527,
                                       0.9921908931812915,
                                       0.8527221762738942,
                                       0.03496940112518232,
                                       0.22919479317057834,
                                       0.6380091288901746,
                                       0.03329140891772331,
                                       0.4434655962686078,
                                       0.6140546880271847,
                                       0.6049292778513715,
                                       0.8845983157047473,
                                       0.5187565119910739,
                                       0.45958691213113745,
                                       0.317342479918148,
                                       0.4536731172546462,
                                       0.1942795849181388,
                                       0.13596727707476342,
                                       0.007921842826076553,
                                       0.290848054525918,
                                       0.8171792662661755,
                                       0.028357492411058116,
                                       0.695459635030089,
                                       0.9297292850189345,
                                       0.8283853636719709,
                                       0.6896760468575567,
                                       0.5004061928319378,
                                       0.5655060981307017,
                                       0.5120046968859553,
                                       0.2870811351605541,
                                       0.49104494765902285,
                                       0.3042674258735121,
                                       0.9202396671021099,
                                       0.3701132534793684,
                                       0.28934686211569405,
                                       0.5596495519904526,
                                       0.4485370611544647,
                                       0.5827264812049985,
                                       0.4317454997180723,
                                       0.6406673646590401,
                                       0.03728142071869567,
                                       0.857937152947629,
                                       0.6171188866116344,
                                       0.5232003602724022,
                                       0.26352030884203537,
                                       0.5328790292223157,
                                       0.33551305279647825,
                                       0.3073471457584256,
                                       0.09859015258325021,
                                       0.3773165596884256,
                                       0.58367287565519,
                                       0.9674106150793919,
                                       0.4382350150053752,
                                       0.6841041985442428,
                                       0.5190145970051133]);
        arr.reshape(9, 8);
        arr = arr.T();

        let mut result = Array::from(vec![0.23496117804708339,
                                          0.819411678218866,
                                          0.6380091288901746,
                                          0.317342479918148,
                                          0.695459635030089,
                                          0.49104494765902285,
                                          0.4317454997180723,
                                          0.33551305279647825,
                                          0.5190145970051133]);
        result.reshape(1, 9);

        let idx: usize = 7;

        assert!(result.rows() == arr.get_rows(&idx).rows());
        assert!(result.cols() == arr.get_rows(&idx).cols());

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_transpose_3() {

        let mut arr = Array::from(vec![0.11150410087280771,
                                       0.8096039756173166,
                                       0.5744293231689495,
                                       0.059355119750942986,
                                       0.7842416618915636,
                                       0.3698268883505256,
                                       0.6987867634920802,
                                       0.9850152274624763,
                                       0.794244913511597,
                                       0.025396092650194824,
                                       0.01084474325417173,
                                       0.0022690198050676624,
                                       0.2921005452564077,
                                       0.7779608346761091,
                                       0.7022235820264277,
                                       0.33857628541159523,
                                       0.21168576739457567,
                                       0.5127633258342936,
                                       0.7148059326047405,
                                       0.02933047462391103,
                                       0.37277204859284707,
                                       0.2622751957229126,
                                       0.769345021219707,
                                       0.8241687223332037,
                                       0.6480223588154045,
                                       0.42766567757621143,
                                       0.16057617377570332]);
        arr.reshape(3, 9);
        arr = arr.T();

        let mut result =
            Array::from(vec![0.5744293231689495, 0.0022690198050676624, 0.37277204859284707]);
        result.reshape(1, 3);

        let idx: usize = 2;

        assert!(result.rows() == arr.get_rows(&idx).rows());
        assert!(result.cols() == arr.get_rows(&idx).cols());

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_transpose_4() {

        let mut arr = Array::from(vec![0.6558098708625699,
                                       0.47151809331807215,
                                       0.05884612525722377,
                                       0.5240257710120293,
                                       0.9370667780812278,
                                       0.7657489477793658,
                                       0.5760646653908316,
                                       0.9256479511538042,
                                       0.4108022698020962,
                                       0.547463796860828,
                                       0.5696259018989306,
                                       0.5318535519727353]);
        arr.reshape(3, 4);
        arr = arr.T();

        let mut result =
            Array::from(vec![0.6558098708625699, 0.9370667780812278, 0.4108022698020962]);
        result.reshape(1, 3);

        let idx: usize = 0;

        assert!(result.rows() == arr.get_rows(&idx).rows());
        assert!(result.cols() == arr.get_rows(&idx).cols());

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_transpose_5() {

        let mut arr = Array::from(vec![0.1676678409149912,
                                       0.861383405027676,
                                       0.9216207547768913,
                                       0.6191954561476947,
                                       0.12362933806379073,
                                       0.44381481157270497,
                                       0.19877703470687746,
                                       0.14107562648466954,
                                       0.6710861414183165,
                                       0.24887924418424412,
                                       0.36999837265698077,
                                       0.34671285416782716,
                                       0.8249131922342992,
                                       0.841648699352834]);
        arr.reshape(2, 7);
        arr = arr.T();

        let mut result = Array::from(vec![0.6191954561476947, 0.36999837265698077]);
        result.reshape(1, 2);

        let idx: usize = 3;

        assert!(result.rows() == arr.get_rows(&idx).rows());
        assert!(result.cols() == arr.get_rows(&idx).cols());

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_transpose_6() {

        let mut arr = Array::from(vec![0.3678106032600512,
                                       0.9177846520753015,
                                       0.7063829900311207,
                                       0.13420500263139923,
                                       0.09380833093393104,
                                       0.8015041392130045,
                                       0.49066927237870794,
                                       0.5416854778529434]);
        arr.reshape(4, 2);
        arr = arr.T();

        let mut result = Array::from(vec![0.3678106032600512,
                                          0.7063829900311207,
                                          0.09380833093393104,
                                          0.49066927237870794]);
        result.reshape(1, 4);

        let idx: usize = 0;

        assert!(result.rows() == arr.get_rows(&idx).rows());
        assert!(result.cols() == arr.get_rows(&idx).cols());

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_transpose_7() {

        let mut arr = Array::from(vec![0.2718385852867393,
                                       0.013460642713719828,
                                       0.12798750635805256,
                                       0.7919986749289545,
                                       0.9391186519981108,
                                       0.9806978175296652,
                                       0.48024033473364547,
                                       0.1669245810689408,
                                       0.6801699678508741,
                                       0.9490436766686265,
                                       0.44904300995572166,
                                       0.23258694099688615,
                                       0.7220265418019424,
                                       0.14200835687922775,
                                       0.10019118536548222,
                                       0.6312223198556238,
                                       0.09417371194068569,
                                       0.13715955368621513,
                                       0.9505754201392806,
                                       0.6387252873419664,
                                       0.9996498787040119,
                                       0.7780565108493451,
                                       0.016974953804198112,
                                       0.2079781316192134,
                                       0.1272207720538362,
                                       0.5722512148113048,
                                       0.9093077469603993,
                                       0.8031151814245743,
                                       0.7878095174291018,
                                       0.68571961443512,
                                       0.2304103778988914,
                                       0.9477147799579432,
                                       0.04830228168121298,
                                       0.23860575739602574,
                                       0.4924570255163495,
                                       0.8433460131727744]);
        arr.reshape(6, 6);
        arr = arr.T();

        let mut result = Array::from(vec![0.2718385852867393,
                                          0.48024033473364547,
                                          0.7220265418019424,
                                          0.9505754201392806,
                                          0.1272207720538362,
                                          0.2304103778988914]);
        result.reshape(1, 6);

        let idx: usize = 0;

        assert!(result.rows() == arr.get_rows(&idx).rows());
        assert!(result.cols() == arr.get_rows(&idx).cols());

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_transpose_8() {

        let mut arr = Array::from(vec![0.7585933989589557,
                                       0.29088432020241584,
                                       0.7643341872939214,
                                       0.836775218001464,
                                       0.3769148476585228,
                                       0.6977319782273234,
                                       0.9199661944212296,
                                       0.4686776725666314,
                                       0.7316101282371349,
                                       0.010247040539513863,
                                       0.04393813135038249,
                                       0.5246689967353431,
                                       0.2908815249594344,
                                       0.1962702360964671,
                                       0.14616285960637965,
                                       0.26404283873074286,
                                       0.29377021478284215,
                                       0.728609074576266,
                                       0.12980871138479078,
                                       0.6287927742441822,
                                       0.1928991963488823,
                                       0.6248893174890445,
                                       0.055569813316688976,
                                       0.4193956556537305,
                                       0.755910885757368,
                                       0.23272758704023733,
                                       0.9134030871532263,
                                       0.2278706667044479,
                                       0.9689881107806262,
                                       0.3147237564886278,
                                       0.62197218783676,
                                       0.14674543088775016,
                                       0.7825943647079507,
                                       0.17626465303951122,
                                       0.031700206452515256,
                                       0.35552418832283306,
                                       0.28987457696053687,
                                       0.9213173807005415,
                                       0.22233723243411985,
                                       0.6330528087199453,
                                       0.05729903201260578,
                                       0.8950982415656692,
                                       0.6337288687754038,
                                       0.46276848503218115,
                                       0.09078810453420316,
                                       0.9821533348159726,
                                       0.7516318919626817,
                                       0.9263977611806433,
                                       0.5772193772944185,
                                       0.44456220698867976,
                                       0.11843053646665092,
                                       0.0033921197532106317,
                                       0.42989727068529604,
                                       0.4456215234976457,
                                       0.2254006325494674,
                                       0.3159194865379922]);
        arr.reshape(7, 8);
        arr = arr.T();

        let mut result = Array::from(vec![0.4686776725666314,
                                          0.26404283873074286,
                                          0.4193956556537305,
                                          0.14674543088775016,
                                          0.6330528087199453,
                                          0.9263977611806433,
                                          0.3159194865379922]);
        result.reshape(1, 7);

        let idx: usize = 7;

        assert!(result.rows() == arr.get_rows(&idx).rows());
        assert!(result.cols() == arr.get_rows(&idx).cols());

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_scalar_get_rows_transpose_9() {

        let mut arr = Array::from(vec![0.9058704104647929,
                                       0.9174485614828881,
                                       0.2406691976095029,
                                       0.220714202251722,
                                       0.042199568357976114,
                                       0.48665612442387685,
                                       0.7575461347311593,
                                       0.22419192871566973,
                                       0.7097752684375215,
                                       0.1925008894000757,
                                       0.47933693147499434,
                                       0.12753850011229628,
                                       0.2843434588211813,
                                       0.10319057485057492,
                                       0.32444345473467084,
                                       0.6295224472317583,
                                       0.6165680202130384,
                                       0.2385542680818219,
                                       0.129278413055962,
                                       0.9159942040797456,
                                       0.49442243513535344,
                                       0.5507984587600816,
                                       0.6474250958230049,
                                       0.8448279100953802,
                                       0.9713486908733158,
                                       0.1182634921189929,
                                       0.0448569910081652,
                                       0.15855114104871249,
                                       0.9514234005377552,
                                       0.42671958367097107,
                                       0.5068355074640134,
                                       0.025359934640823978,
                                       0.015614477870282917,
                                       0.5521159014023806,
                                       0.8069985935631249]);
        arr.reshape(5, 7);
        arr = arr.T();

        let mut result = Array::from(vec![0.9058704104647929,
                                          0.22419192871566973,
                                          0.32444345473467084,
                                          0.5507984587600816,
                                          0.9514234005377552]);
        result.reshape(1, 5);

        let idx: usize = 0;

        assert!(result.rows() == arr.get_rows(&idx).rows());
        assert!(result.cols() == arr.get_rows(&idx).cols());

        assert!(allclose(&arr.get_rows(&idx), &result));
    }



    #[test]
    fn test_vector_get_rows_0() {

        let mut arr = Array::from(vec![0.3026844973337608,
                                       0.8583123142333691,
                                       0.16731151966900837,
                                       0.33635588451063736,
                                       0.25153161820736425,
                                       0.8198965297579482,
                                       0.19126813305801438,
                                       0.13342028215153323,
                                       0.3797980276515116,
                                       0.4900123765802087,
                                       0.616117445213224,
                                       0.1828317097820401,
                                       0.5898986540355099,
                                       0.3692672059112524,
                                       0.6908363003317866,
                                       0.9633087827572147,
                                       0.163924010361174,
                                       0.787286431532979,
                                       0.0062766626905627065,
                                       0.011035925966384141,
                                       0.1510046354942679,
                                       0.14695199875222964,
                                       0.9807243048269062,
                                       0.12424636914338416,
                                       0.6790951821322875,
                                       0.8923964585077467,
                                       0.739767274915941,
                                       0.010890909522523917,
                                       0.6574676777099638,
                                       0.6136875926278141,
                                       0.4347439135955087,
                                       0.8487007059005109,
                                       0.5333639316338004,
                                       0.967014539220958,
                                       0.40717927241375096,
                                       0.5224381236816471,
                                       0.06735827556768936,
                                       0.9123264304961389,
                                       0.9182013378973746,
                                       0.9388849921242717,
                                       0.5490865080468417,
                                       0.4681106050264714,
                                       0.8696358174378072,
                                       0.9809946801858267,
                                       0.7491782709821655,
                                       0.5770106605516356,
                                       0.02573069722647492,
                                       0.996612204499,
                                       0.9429686133491813,
                                       0.8358333441720264,
                                       0.33798216924245283,
                                       0.7930204735387772,
                                       0.6955254885973183,
                                       0.09245543915764765]);
        arr.reshape(6, 9);

        let mut result = Array::from(vec![0.010890909522523917,
                                          0.6574676777099638,
                                          0.6136875926278141,
                                          0.4347439135955087,
                                          0.8487007059005109,
                                          0.5333639316338004,
                                          0.967014539220958,
                                          0.40717927241375096,
                                          0.5224381236816471,
                                          0.3026844973337608,
                                          0.8583123142333691,
                                          0.16731151966900837,
                                          0.33635588451063736,
                                          0.25153161820736425,
                                          0.8198965297579482,
                                          0.19126813305801438,
                                          0.13342028215153323,
                                          0.3797980276515116,
                                          0.5770106605516356,
                                          0.02573069722647492,
                                          0.996612204499,
                                          0.9429686133491813,
                                          0.8358333441720264,
                                          0.33798216924245283,
                                          0.7930204735387772,
                                          0.6955254885973183,
                                          0.09245543915764765,
                                          0.3026844973337608,
                                          0.8583123142333691,
                                          0.16731151966900837,
                                          0.33635588451063736,
                                          0.25153161820736425,
                                          0.8198965297579482,
                                          0.19126813305801438,
                                          0.13342028215153323,
                                          0.3797980276515116,
                                          0.5770106605516356,
                                          0.02573069722647492,
                                          0.996612204499,
                                          0.9429686133491813,
                                          0.8358333441720264,
                                          0.33798216924245283,
                                          0.7930204735387772,
                                          0.6955254885973183,
                                          0.09245543915764765,
                                          0.4900123765802087,
                                          0.616117445213224,
                                          0.1828317097820401,
                                          0.5898986540355099,
                                          0.3692672059112524,
                                          0.6908363003317866,
                                          0.9633087827572147,
                                          0.163924010361174,
                                          0.787286431532979,
                                          0.3026844973337608,
                                          0.8583123142333691,
                                          0.16731151966900837,
                                          0.33635588451063736,
                                          0.25153161820736425,
                                          0.8198965297579482,
                                          0.19126813305801438,
                                          0.13342028215153323,
                                          0.3797980276515116,
                                          0.0062766626905627065,
                                          0.011035925966384141,
                                          0.1510046354942679,
                                          0.14695199875222964,
                                          0.9807243048269062,
                                          0.12424636914338416,
                                          0.6790951821322875,
                                          0.8923964585077467,
                                          0.739767274915941,
                                          0.4900123765802087,
                                          0.616117445213224,
                                          0.1828317097820401,
                                          0.5898986540355099,
                                          0.3692672059112524,
                                          0.6908363003317866,
                                          0.9633087827572147,
                                          0.163924010361174,
                                          0.787286431532979,
                                          0.3026844973337608,
                                          0.8583123142333691,
                                          0.16731151966900837,
                                          0.33635588451063736,
                                          0.25153161820736425,
                                          0.8198965297579482,
                                          0.19126813305801438,
                                          0.13342028215153323,
                                          0.3797980276515116,
                                          0.3026844973337608,
                                          0.8583123142333691,
                                          0.16731151966900837,
                                          0.33635588451063736,
                                          0.25153161820736425,
                                          0.8198965297579482,
                                          0.19126813305801438,
                                          0.13342028215153323,
                                          0.3797980276515116,
                                          0.0062766626905627065,
                                          0.011035925966384141,
                                          0.1510046354942679,
                                          0.14695199875222964,
                                          0.9807243048269062,
                                          0.12424636914338416,
                                          0.6790951821322875,
                                          0.8923964585077467,
                                          0.739767274915941,
                                          0.06735827556768936,
                                          0.9123264304961389,
                                          0.9182013378973746,
                                          0.9388849921242717,
                                          0.5490865080468417,
                                          0.4681106050264714,
                                          0.8696358174378072,
                                          0.9809946801858267,
                                          0.7491782709821655,
                                          0.5770106605516356,
                                          0.02573069722647492,
                                          0.996612204499,
                                          0.9429686133491813,
                                          0.8358333441720264,
                                          0.33798216924245283,
                                          0.7930204735387772,
                                          0.6955254885973183,
                                          0.09245543915764765,
                                          0.3026844973337608,
                                          0.8583123142333691,
                                          0.16731151966900837,
                                          0.33635588451063736,
                                          0.25153161820736425,
                                          0.8198965297579482,
                                          0.19126813305801438,
                                          0.13342028215153323,
                                          0.3797980276515116,
                                          0.3026844973337608,
                                          0.8583123142333691,
                                          0.16731151966900837,
                                          0.33635588451063736,
                                          0.25153161820736425,
                                          0.8198965297579482,
                                          0.19126813305801438,
                                          0.13342028215153323,
                                          0.3797980276515116,
                                          0.010890909522523917,
                                          0.6574676777099638,
                                          0.6136875926278141,
                                          0.4347439135955087,
                                          0.8487007059005109,
                                          0.5333639316338004,
                                          0.967014539220958,
                                          0.40717927241375096,
                                          0.5224381236816471,
                                          0.5770106605516356,
                                          0.02573069722647492,
                                          0.996612204499,
                                          0.9429686133491813,
                                          0.8358333441720264,
                                          0.33798216924245283,
                                          0.7930204735387772,
                                          0.6955254885973183,
                                          0.09245543915764765]);
        result.reshape(18, 9);

        let row_indices = vec![3, 0, 5, 0, 5, 1, 0, 2, 1, 0, 0, 2, 4, 5, 0, 0, 3, 5];

        assert!(allclose(&arr.get_rows(&row_indices), &result));
    }



    #[test]
    fn test_vector_get_rows_1() {

        let mut arr = Array::from(vec![0.40258765614931946,
                                       0.8648480271843979,
                                       0.6708914564572481,
                                       0.06757502395018489,
                                       0.4413393834989374,
                                       0.08968535802444089,
                                       0.8213416852040862,
                                       0.457376335302924,
                                       0.23855110040042882,
                                       0.616438629950499,
                                       0.5387156695241515,
                                       0.37018301896466577,
                                       0.6912342106136757,
                                       0.5195059603022482,
                                       0.0724011456810435,
                                       0.13496393429333542]);
        arr.reshape(2, 8);

        let mut result = Array::from(vec![0.23855110040042882,
                                          0.616438629950499,
                                          0.5387156695241515,
                                          0.37018301896466577,
                                          0.6912342106136757,
                                          0.5195059603022482,
                                          0.0724011456810435,
                                          0.13496393429333542,
                                          0.40258765614931946,
                                          0.8648480271843979,
                                          0.6708914564572481,
                                          0.06757502395018489,
                                          0.4413393834989374,
                                          0.08968535802444089,
                                          0.8213416852040862,
                                          0.457376335302924,
                                          0.40258765614931946,
                                          0.8648480271843979,
                                          0.6708914564572481,
                                          0.06757502395018489,
                                          0.4413393834989374,
                                          0.08968535802444089,
                                          0.8213416852040862,
                                          0.457376335302924,
                                          0.40258765614931946,
                                          0.8648480271843979,
                                          0.6708914564572481,
                                          0.06757502395018489,
                                          0.4413393834989374,
                                          0.08968535802444089,
                                          0.8213416852040862,
                                          0.457376335302924,
                                          0.23855110040042882,
                                          0.616438629950499,
                                          0.5387156695241515,
                                          0.37018301896466577,
                                          0.6912342106136757,
                                          0.5195059603022482,
                                          0.0724011456810435,
                                          0.13496393429333542,
                                          0.23855110040042882,
                                          0.616438629950499,
                                          0.5387156695241515,
                                          0.37018301896466577,
                                          0.6912342106136757,
                                          0.5195059603022482,
                                          0.0724011456810435,
                                          0.13496393429333542]);
        result.reshape(6, 8);

        let row_indices = vec![1, 0, 0, 0, 1, 1];

        assert!(allclose(&arr.get_rows(&row_indices), &result));
    }



    #[test]
    fn test_vector_get_rows_2() {

        let mut arr = Array::from(vec![0.7146019424816038,
                                       0.7604593963908357,
                                       0.547861287122224,
                                       0.806551731427299,
                                       0.8976235506641399,
                                       0.837475405322677]);
        arr.reshape(3, 2);

        let mut result = Array::from(vec![0.8976235506641399,
                                          0.837475405322677,
                                          0.8976235506641399,
                                          0.837475405322677,
                                          0.8976235506641399,
                                          0.837475405322677,
                                          0.7146019424816038,
                                          0.7604593963908357,
                                          0.547861287122224,
                                          0.806551731427299,
                                          0.8976235506641399,
                                          0.837475405322677,
                                          0.8976235506641399,
                                          0.837475405322677,
                                          0.8976235506641399,
                                          0.837475405322677,
                                          0.7146019424816038,
                                          0.7604593963908357]);
        result.reshape(9, 2);

        let row_indices = vec![2, 2, 2, 0, 1, 2, 2, 2, 0];

        assert!(allclose(&arr.get_rows(&row_indices), &result));
    }



    #[test]
    fn test_vector_get_rows_3() {

        let mut arr = Array::from(vec![0.2505884199600942,
                                       0.49024553437887664,
                                       0.144728966583754,
                                       0.6285692473489818,
                                       0.6366624500674968,
                                       0.5259820200687467,
                                       0.6229188777968119,
                                       0.1108941671517305,
                                       0.9981887673808209,
                                       0.695013205184841,
                                       0.8430025598280413,
                                       0.06877934668725594,
                                       0.1865271289078707,
                                       0.834327304480662,
                                       0.6973326180719766,
                                       0.7337671453471607,
                                       0.06550764176187263,
                                       0.3121230981253994,
                                       0.695656664836412,
                                       0.3669402084032456,
                                       0.9234219334387136,
                                       0.4627697526924629,
                                       0.10224532398210873,
                                       0.2849527838404887,
                                       0.4057823573720447,
                                       0.18238603082813143,
                                       0.412660297610816,
                                       0.856733381427474,
                                       0.6539807660395075,
                                       0.5551732967298979,
                                       0.4380490943165041,
                                       0.889643380848384,
                                       0.4817776492498722,
                                       0.5983094652632307,
                                       0.2623658934182619,
                                       0.23962451838010246,
                                       0.00884989893626087,
                                       0.9057841488055146,
                                       0.24524862385794655,
                                       0.9715877319119964,
                                       0.26277368049984917,
                                       0.7770402747102846,
                                       0.6565242488306049,
                                       0.5284852136062448,
                                       0.18581485402229525,
                                       0.8242536596595306,
                                       0.9554458372087256,
                                       0.1590267262839623]);
        arr.reshape(8, 6);

        let mut result = Array::from(vec![0.695656664836412,
                                          0.3669402084032456,
                                          0.9234219334387136,
                                          0.4627697526924629,
                                          0.10224532398210873,
                                          0.2849527838404887,
                                          0.6565242488306049,
                                          0.5284852136062448,
                                          0.18581485402229525,
                                          0.8242536596595306,
                                          0.9554458372087256,
                                          0.1590267262839623,
                                          0.4057823573720447,
                                          0.18238603082813143,
                                          0.412660297610816,
                                          0.856733381427474,
                                          0.6539807660395075,
                                          0.5551732967298979,
                                          0.6565242488306049,
                                          0.5284852136062448,
                                          0.18581485402229525,
                                          0.8242536596595306,
                                          0.9554458372087256,
                                          0.1590267262839623,
                                          0.00884989893626087,
                                          0.9057841488055146,
                                          0.24524862385794655,
                                          0.9715877319119964,
                                          0.26277368049984917,
                                          0.7770402747102846,
                                          0.4057823573720447,
                                          0.18238603082813143,
                                          0.412660297610816,
                                          0.856733381427474,
                                          0.6539807660395075,
                                          0.5551732967298979,
                                          0.6229188777968119,
                                          0.1108941671517305,
                                          0.9981887673808209,
                                          0.695013205184841,
                                          0.8430025598280413,
                                          0.06877934668725594,
                                          0.6229188777968119,
                                          0.1108941671517305,
                                          0.9981887673808209,
                                          0.695013205184841,
                                          0.8430025598280413,
                                          0.06877934668725594,
                                          0.4057823573720447,
                                          0.18238603082813143,
                                          0.412660297610816,
                                          0.856733381427474,
                                          0.6539807660395075,
                                          0.5551732967298979,
                                          0.1865271289078707,
                                          0.834327304480662,
                                          0.6973326180719766,
                                          0.7337671453471607,
                                          0.06550764176187263,
                                          0.3121230981253994,
                                          0.6229188777968119,
                                          0.1108941671517305,
                                          0.9981887673808209,
                                          0.695013205184841,
                                          0.8430025598280413,
                                          0.06877934668725594,
                                          0.2505884199600942,
                                          0.49024553437887664,
                                          0.144728966583754,
                                          0.6285692473489818,
                                          0.6366624500674968,
                                          0.5259820200687467,
                                          0.2505884199600942,
                                          0.49024553437887664,
                                          0.144728966583754,
                                          0.6285692473489818,
                                          0.6366624500674968,
                                          0.5259820200687467,
                                          0.00884989893626087,
                                          0.9057841488055146,
                                          0.24524862385794655,
                                          0.9715877319119964,
                                          0.26277368049984917,
                                          0.7770402747102846,
                                          0.1865271289078707,
                                          0.834327304480662,
                                          0.6973326180719766,
                                          0.7337671453471607,
                                          0.06550764176187263,
                                          0.3121230981253994,
                                          0.4380490943165041,
                                          0.889643380848384,
                                          0.4817776492498722,
                                          0.5983094652632307,
                                          0.2623658934182619,
                                          0.23962451838010246,
                                          0.4380490943165041,
                                          0.889643380848384,
                                          0.4817776492498722,
                                          0.5983094652632307,
                                          0.2623658934182619,
                                          0.23962451838010246,
                                          0.2505884199600942,
                                          0.49024553437887664,
                                          0.144728966583754,
                                          0.6285692473489818,
                                          0.6366624500674968,
                                          0.5259820200687467,
                                          0.6229188777968119,
                                          0.1108941671517305,
                                          0.9981887673808209,
                                          0.695013205184841,
                                          0.8430025598280413,
                                          0.06877934668725594,
                                          0.00884989893626087,
                                          0.9057841488055146,
                                          0.24524862385794655,
                                          0.9715877319119964,
                                          0.26277368049984917,
                                          0.7770402747102846,
                                          0.4057823573720447,
                                          0.18238603082813143,
                                          0.412660297610816,
                                          0.856733381427474,
                                          0.6539807660395075,
                                          0.5551732967298979,
                                          0.6229188777968119,
                                          0.1108941671517305,
                                          0.9981887673808209,
                                          0.695013205184841,
                                          0.8430025598280413,
                                          0.06877934668725594,
                                          0.6565242488306049,
                                          0.5284852136062448,
                                          0.18581485402229525,
                                          0.8242536596595306,
                                          0.9554458372087256,
                                          0.1590267262839623,
                                          0.6229188777968119,
                                          0.1108941671517305,
                                          0.9981887673808209,
                                          0.695013205184841,
                                          0.8430025598280413,
                                          0.06877934668725594]);
        result.reshape(24, 6);

        let row_indices = vec![3, 7, 4, 7, 6, 4, 1, 1, 4, 2, 1, 0, 0, 6, 2, 5, 5, 0, 1, 6, 4, 1,
                               7, 1];

        assert!(allclose(&arr.get_rows(&row_indices), &result));
    }



    #[test]
    fn test_vector_get_rows_4() {

        let mut arr = Array::from(vec![0.6418545486584504,
                                       0.698072460973478,
                                       0.4923078842530585,
                                       0.47437858537223776,
                                       0.7435934406874709]);
        arr.reshape(5, 1);

        let mut result = Array::from(vec![0.6418545486584504,
                                          0.47437858537223776,
                                          0.7435934406874709,
                                          0.6418545486584504,
                                          0.698072460973478,
                                          0.7435934406874709,
                                          0.7435934406874709,
                                          0.47437858537223776,
                                          0.7435934406874709,
                                          0.4923078842530585,
                                          0.698072460973478,
                                          0.7435934406874709,
                                          0.7435934406874709,
                                          0.698072460973478,
                                          0.4923078842530585]);
        result.reshape(15, 1);

        let row_indices = vec![0, 3, 4, 0, 1, 4, 4, 3, 4, 2, 1, 4, 4, 1, 2];

        assert!(allclose(&arr.get_rows(&row_indices), &result));
    }



    #[test]
    fn test_vector_get_rows_5() {

        let mut arr = Array::from(vec![0.819358467518517,
                                       0.009406812625449512,
                                       0.5327024186084796,
                                       0.6398490954260115,
                                       0.32573240418057636,
                                       0.8534213204353883,
                                       0.6788630404199507,
                                       0.1737116431972744,
                                       0.33537126000813644,
                                       0.1268993925657509,
                                       0.5798735177443395,
                                       0.8622107475596431,
                                       0.9911988496391825,
                                       0.5527702746550726,
                                       0.04320273618352122,
                                       0.8123342963358758,
                                       0.5007629131321141,
                                       0.15361949182403334,
                                       0.1182076776850719,
                                       0.764703550471804]);
        arr.reshape(5, 4);

        let mut result = Array::from(vec![0.819358467518517,
                                          0.009406812625449512,
                                          0.5327024186084796,
                                          0.6398490954260115,
                                          0.32573240418057636,
                                          0.8534213204353883,
                                          0.6788630404199507,
                                          0.1737116431972744,
                                          0.5007629131321141,
                                          0.15361949182403334,
                                          0.1182076776850719,
                                          0.764703550471804,
                                          0.32573240418057636,
                                          0.8534213204353883,
                                          0.6788630404199507,
                                          0.1737116431972744,
                                          0.9911988496391825,
                                          0.5527702746550726,
                                          0.04320273618352122,
                                          0.8123342963358758,
                                          0.5007629131321141,
                                          0.15361949182403334,
                                          0.1182076776850719,
                                          0.764703550471804,
                                          0.9911988496391825,
                                          0.5527702746550726,
                                          0.04320273618352122,
                                          0.8123342963358758,
                                          0.33537126000813644,
                                          0.1268993925657509,
                                          0.5798735177443395,
                                          0.8622107475596431,
                                          0.33537126000813644,
                                          0.1268993925657509,
                                          0.5798735177443395,
                                          0.8622107475596431,
                                          0.33537126000813644,
                                          0.1268993925657509,
                                          0.5798735177443395,
                                          0.8622107475596431,
                                          0.819358467518517,
                                          0.009406812625449512,
                                          0.5327024186084796,
                                          0.6398490954260115,
                                          0.32573240418057636,
                                          0.8534213204353883,
                                          0.6788630404199507,
                                          0.1737116431972744,
                                          0.819358467518517,
                                          0.009406812625449512,
                                          0.5327024186084796,
                                          0.6398490954260115,
                                          0.9911988496391825,
                                          0.5527702746550726,
                                          0.04320273618352122,
                                          0.8123342963358758,
                                          0.5007629131321141,
                                          0.15361949182403334,
                                          0.1182076776850719,
                                          0.764703550471804]);
        result.reshape(15, 4);

        let row_indices = vec![0, 1, 4, 1, 3, 4, 3, 2, 2, 2, 0, 1, 0, 3, 4];

        assert!(allclose(&arr.get_rows(&row_indices), &result));
    }



    #[test]
    fn test_vector_get_rows_6() {

        let mut arr = Array::from(vec![0.6900150631232679,
                                       0.7731518741359212,
                                       0.34912537458948045,
                                       0.1709133857024866,
                                       0.13747958011812222,
                                       0.664095105359734,
                                       0.7710649587420478,
                                       0.9962079319111661,
                                       0.7229867591675645,
                                       0.7590563174316188,
                                       0.017267460477273566,
                                       0.4925750669418595,
                                       0.6809995305980964,
                                       0.040766766137549704,
                                       0.3005275479442364,
                                       0.491532843254729,
                                       0.7006624453094809,
                                       0.0026875257677486664]);
        arr.reshape(9, 2);

        let mut result = Array::from(vec![0.7710649587420478,
                                          0.9962079319111661,
                                          0.34912537458948045,
                                          0.1709133857024866,
                                          0.3005275479442364,
                                          0.491532843254729,
                                          0.017267460477273566,
                                          0.4925750669418595,
                                          0.34912537458948045,
                                          0.1709133857024866,
                                          0.7229867591675645,
                                          0.7590563174316188,
                                          0.7006624453094809,
                                          0.0026875257677486664,
                                          0.6900150631232679,
                                          0.7731518741359212,
                                          0.6809995305980964,
                                          0.040766766137549704,
                                          0.017267460477273566,
                                          0.4925750669418595,
                                          0.7229867591675645,
                                          0.7590563174316188,
                                          0.7710649587420478,
                                          0.9962079319111661,
                                          0.017267460477273566,
                                          0.4925750669418595,
                                          0.6809995305980964,
                                          0.040766766137549704,
                                          0.13747958011812222,
                                          0.664095105359734,
                                          0.7710649587420478,
                                          0.9962079319111661,
                                          0.7229867591675645,
                                          0.7590563174316188,
                                          0.3005275479442364,
                                          0.491532843254729,
                                          0.13747958011812222,
                                          0.664095105359734,
                                          0.6900150631232679,
                                          0.7731518741359212,
                                          0.13747958011812222,
                                          0.664095105359734,
                                          0.017267460477273566,
                                          0.4925750669418595,
                                          0.017267460477273566,
                                          0.4925750669418595,
                                          0.34912537458948045,
                                          0.1709133857024866,
                                          0.7229867591675645,
                                          0.7590563174316188,
                                          0.7229867591675645,
                                          0.7590563174316188,
                                          0.7006624453094809,
                                          0.0026875257677486664]);
        result.reshape(27, 2);

        let row_indices = vec![3, 1, 7, 5, 1, 4, 8, 0, 6, 5, 4, 3, 5, 6, 2, 3, 4, 7, 2, 0, 2, 5,
                               5, 1, 4, 4, 8];

        assert!(allclose(&arr.get_rows(&row_indices), &result));
    }



    #[test]
    fn test_vector_get_rows_7() {

        let mut arr = Array::from(vec![0.9809742862124755,
                                       0.45876863559686953,
                                       0.8921192752561767,
                                       0.4496693736012606,
                                       0.8548674608930824,
                                       0.6499230764988503,
                                       0.08914519817649025,
                                       0.9742340082767662]);
        arr.reshape(8, 1);

        let mut result = Array::from(vec![0.9742340082767662,
                                          0.8921192752561767,
                                          0.45876863559686953,
                                          0.9809742862124755,
                                          0.8548674608930824,
                                          0.6499230764988503,
                                          0.9809742862124755,
                                          0.8548674608930824,
                                          0.8921192752561767,
                                          0.4496693736012606,
                                          0.08914519817649025,
                                          0.45876863559686953,
                                          0.8548674608930824,
                                          0.9809742862124755,
                                          0.08914519817649025,
                                          0.45876863559686953,
                                          0.45876863559686953,
                                          0.4496693736012606,
                                          0.9809742862124755,
                                          0.08914519817649025,
                                          0.08914519817649025,
                                          0.6499230764988503,
                                          0.6499230764988503,
                                          0.45876863559686953]);
        result.reshape(24, 1);

        let row_indices = vec![7, 2, 1, 0, 4, 5, 0, 4, 2, 3, 6, 1, 4, 0, 6, 1, 1, 3, 0, 6, 6, 5,
                               5, 1];

        assert!(allclose(&arr.get_rows(&row_indices), &result));
    }



    #[test]
    fn test_vector_get_rows_8() {

        let mut arr = Array::from(vec![0.751709653232715,
                                       0.7756910087539991,
                                       0.5504751396551519,
                                       0.20474158382817575,
                                       0.2997018642810668,
                                       0.48405352548051805,
                                       0.661170305597254,
                                       0.020350315122093288,
                                       0.8922053189738424,
                                       0.7459105873555202,
                                       0.5195262617458084,
                                       0.9985331097507912,
                                       0.26088353014360777,
                                       0.2552270403611949,
                                       0.5343326342043001,
                                       0.22971192633100435,
                                       0.7719378728355539,
                                       0.47782380137572855,
                                       0.5761747752392753,
                                       0.5600443043446207,
                                       0.36239152439432665,
                                       0.44024149151879477,
                                       0.44396773449968385,
                                       0.2429694031521269,
                                       0.9321179241793749,
                                       0.7498620431109351,
                                       0.8615156210253515,
                                       0.0002734266745958447,
                                       0.5109176556349699,
                                       0.7732697225620627,
                                       0.04579321708009976,
                                       0.9931324883531597,
                                       0.06772954439271461,
                                       0.7670567693562633,
                                       0.7806116771942163,
                                       0.7228187765847592,
                                       0.43007154425460414,
                                       0.16253574685246341,
                                       0.7396077555280184,
                                       0.611832276792692,
                                       0.5411739307316743,
                                       0.525478505436911,
                                       0.1130763245253541,
                                       0.564466682768384,
                                       0.7914634227919178,
                                       0.19962502963620465,
                                       0.7222048225287095,
                                       0.38156195755806055,
                                       0.06388072451634419,
                                       0.2145921979438138,
                                       0.46986905666160494,
                                       0.4359724620028569,
                                       0.6761247374630346,
                                       0.7817905297679897,
                                       0.5724638243073898,
                                       0.7306214231067651,
                                       0.8034977391607832,
                                       0.3327528376971386,
                                       0.7473018037656469,
                                       0.5342787537083562,
                                       0.9642799365706598,
                                       0.9393284325065456,
                                       0.04231331894218049]);
        arr.reshape(9, 7);

        let mut result = Array::from(vec![0.2145921979438138,
                                          0.46986905666160494,
                                          0.4359724620028569,
                                          0.6761247374630346,
                                          0.7817905297679897,
                                          0.5724638243073898,
                                          0.7306214231067651,
                                          0.5109176556349699,
                                          0.7732697225620627,
                                          0.04579321708009976,
                                          0.9931324883531597,
                                          0.06772954439271461,
                                          0.7670567693562633,
                                          0.7806116771942163,
                                          0.44024149151879477,
                                          0.44396773449968385,
                                          0.2429694031521269,
                                          0.9321179241793749,
                                          0.7498620431109351,
                                          0.8615156210253515,
                                          0.0002734266745958447,
                                          0.5343326342043001,
                                          0.22971192633100435,
                                          0.7719378728355539,
                                          0.47782380137572855,
                                          0.5761747752392753,
                                          0.5600443043446207,
                                          0.36239152439432665,
                                          0.020350315122093288,
                                          0.8922053189738424,
                                          0.7459105873555202,
                                          0.5195262617458084,
                                          0.9985331097507912,
                                          0.26088353014360777,
                                          0.2552270403611949,
                                          0.2145921979438138,
                                          0.46986905666160494,
                                          0.4359724620028569,
                                          0.6761247374630346,
                                          0.7817905297679897,
                                          0.5724638243073898,
                                          0.7306214231067651,
                                          0.751709653232715,
                                          0.7756910087539991,
                                          0.5504751396551519,
                                          0.20474158382817575,
                                          0.2997018642810668,
                                          0.48405352548051805,
                                          0.661170305597254,
                                          0.2145921979438138,
                                          0.46986905666160494,
                                          0.4359724620028569,
                                          0.6761247374630346,
                                          0.7817905297679897,
                                          0.5724638243073898,
                                          0.7306214231067651,
                                          0.44024149151879477,
                                          0.44396773449968385,
                                          0.2429694031521269,
                                          0.9321179241793749,
                                          0.7498620431109351,
                                          0.8615156210253515,
                                          0.0002734266745958447,
                                          0.8034977391607832,
                                          0.3327528376971386,
                                          0.7473018037656469,
                                          0.5342787537083562,
                                          0.9642799365706598,
                                          0.9393284325065456,
                                          0.04231331894218049,
                                          0.5109176556349699,
                                          0.7732697225620627,
                                          0.04579321708009976,
                                          0.9931324883531597,
                                          0.06772954439271461,
                                          0.7670567693562633,
                                          0.7806116771942163,
                                          0.020350315122093288,
                                          0.8922053189738424,
                                          0.7459105873555202,
                                          0.5195262617458084,
                                          0.9985331097507912,
                                          0.26088353014360777,
                                          0.2552270403611949,
                                          0.2145921979438138,
                                          0.46986905666160494,
                                          0.4359724620028569,
                                          0.6761247374630346,
                                          0.7817905297679897,
                                          0.5724638243073898,
                                          0.7306214231067651,
                                          0.020350315122093288,
                                          0.8922053189738424,
                                          0.7459105873555202,
                                          0.5195262617458084,
                                          0.9985331097507912,
                                          0.26088353014360777,
                                          0.2552270403611949,
                                          0.5343326342043001,
                                          0.22971192633100435,
                                          0.7719378728355539,
                                          0.47782380137572855,
                                          0.5761747752392753,
                                          0.5600443043446207,
                                          0.36239152439432665,
                                          0.2145921979438138,
                                          0.46986905666160494,
                                          0.4359724620028569,
                                          0.6761247374630346,
                                          0.7817905297679897,
                                          0.5724638243073898,
                                          0.7306214231067651,
                                          0.5109176556349699,
                                          0.7732697225620627,
                                          0.04579321708009976,
                                          0.9931324883531597,
                                          0.06772954439271461,
                                          0.7670567693562633,
                                          0.7806116771942163,
                                          0.44024149151879477,
                                          0.44396773449968385,
                                          0.2429694031521269,
                                          0.9321179241793749,
                                          0.7498620431109351,
                                          0.8615156210253515,
                                          0.0002734266745958447,
                                          0.2145921979438138,
                                          0.46986905666160494,
                                          0.4359724620028569,
                                          0.6761247374630346,
                                          0.7817905297679897,
                                          0.5724638243073898,
                                          0.7306214231067651,
                                          0.7228187765847592,
                                          0.43007154425460414,
                                          0.16253574685246341,
                                          0.7396077555280184,
                                          0.611832276792692,
                                          0.5411739307316743,
                                          0.525478505436911,
                                          0.5343326342043001,
                                          0.22971192633100435,
                                          0.7719378728355539,
                                          0.47782380137572855,
                                          0.5761747752392753,
                                          0.5600443043446207,
                                          0.36239152439432665,
                                          0.1130763245253541,
                                          0.564466682768384,
                                          0.7914634227919178,
                                          0.19962502963620465,
                                          0.7222048225287095,
                                          0.38156195755806055,
                                          0.06388072451634419,
                                          0.8034977391607832,
                                          0.3327528376971386,
                                          0.7473018037656469,
                                          0.5342787537083562,
                                          0.9642799365706598,
                                          0.9393284325065456,
                                          0.04231331894218049,
                                          0.7228187765847592,
                                          0.43007154425460414,
                                          0.16253574685246341,
                                          0.7396077555280184,
                                          0.611832276792692,
                                          0.5411739307316743,
                                          0.525478505436911,
                                          0.751709653232715,
                                          0.7756910087539991,
                                          0.5504751396551519,
                                          0.20474158382817575,
                                          0.2997018642810668,
                                          0.48405352548051805,
                                          0.661170305597254,
                                          0.5343326342043001,
                                          0.22971192633100435,
                                          0.7719378728355539,
                                          0.47782380137572855,
                                          0.5761747752392753,
                                          0.5600443043446207,
                                          0.36239152439432665,
                                          0.751709653232715,
                                          0.7756910087539991,
                                          0.5504751396551519,
                                          0.20474158382817575,
                                          0.2997018642810668,
                                          0.48405352548051805,
                                          0.661170305597254]);
        result.reshape(27, 7);

        let row_indices = vec![7, 4, 3, 2, 1, 7, 0, 7, 3, 8, 4, 1, 7, 1, 2, 7, 4, 3, 7, 5, 2, 6,
                               8, 5, 0, 2, 0];

        assert!(allclose(&arr.get_rows(&row_indices), &result));
    }



    #[test]
    fn test_vector_get_rows_9() {

        let mut arr = Array::from(vec![0.8751940474245478,
                                       0.7200327656901061,
                                       0.8025573700139234,
                                       0.8702428712065159,
                                       0.4223003750624127,
                                       0.2964625971077186,
                                       0.3768516801106607,
                                       0.7966622926398341,
                                       0.8151088765493302,
                                       0.5379149571200327,
                                       0.1074410804224426,
                                       0.3902887576702486,
                                       0.7686278406178223,
                                       0.4018098819435899,
                                       0.9702119168942321,
                                       0.39072085218690344,
                                       0.9111009439807813,
                                       0.4226698209640033,
                                       0.5292444768122545,
                                       0.32618019582547464,
                                       0.026073392823797392,
                                       0.7375491512448457,
                                       0.5187852631960822,
                                       0.5666406905758409,
                                       0.49549394126787416,
                                       0.43004391495324124,
                                       0.8962503037090311,
                                       0.6362379182176706,
                                       0.2605960713261556,
                                       0.41762440895716757,
                                       0.7373843974158949,
                                       0.913378739973925,
                                       0.34114790713481635,
                                       0.5589204512553507,
                                       0.4303328844354496]);
        arr.reshape(7, 5);

        let mut result = Array::from(vec![0.39072085218690344,
                                          0.9111009439807813,
                                          0.4226698209640033,
                                          0.5292444768122545,
                                          0.32618019582547464,
                                          0.39072085218690344,
                                          0.9111009439807813,
                                          0.4226698209640033,
                                          0.5292444768122545,
                                          0.32618019582547464,
                                          0.026073392823797392,
                                          0.7375491512448457,
                                          0.5187852631960822,
                                          0.5666406905758409,
                                          0.49549394126787416,
                                          0.39072085218690344,
                                          0.9111009439807813,
                                          0.4226698209640033,
                                          0.5292444768122545,
                                          0.32618019582547464,
                                          0.026073392823797392,
                                          0.7375491512448457,
                                          0.5187852631960822,
                                          0.5666406905758409,
                                          0.49549394126787416,
                                          0.8751940474245478,
                                          0.7200327656901061,
                                          0.8025573700139234,
                                          0.8702428712065159,
                                          0.4223003750624127,
                                          0.7373843974158949,
                                          0.913378739973925,
                                          0.34114790713481635,
                                          0.5589204512553507,
                                          0.4303328844354496,
                                          0.39072085218690344,
                                          0.9111009439807813,
                                          0.4226698209640033,
                                          0.5292444768122545,
                                          0.32618019582547464,
                                          0.39072085218690344,
                                          0.9111009439807813,
                                          0.4226698209640033,
                                          0.5292444768122545,
                                          0.32618019582547464,
                                          0.7373843974158949,
                                          0.913378739973925,
                                          0.34114790713481635,
                                          0.5589204512553507,
                                          0.4303328844354496,
                                          0.43004391495324124,
                                          0.8962503037090311,
                                          0.6362379182176706,
                                          0.2605960713261556,
                                          0.41762440895716757,
                                          0.39072085218690344,
                                          0.9111009439807813,
                                          0.4226698209640033,
                                          0.5292444768122545,
                                          0.32618019582547464,
                                          0.7373843974158949,
                                          0.913378739973925,
                                          0.34114790713481635,
                                          0.5589204512553507,
                                          0.4303328844354496,
                                          0.39072085218690344,
                                          0.9111009439807813,
                                          0.4226698209640033,
                                          0.5292444768122545,
                                          0.32618019582547464,
                                          0.39072085218690344,
                                          0.9111009439807813,
                                          0.4226698209640033,
                                          0.5292444768122545,
                                          0.32618019582547464,
                                          0.1074410804224426,
                                          0.3902887576702486,
                                          0.7686278406178223,
                                          0.4018098819435899,
                                          0.9702119168942321,
                                          0.8751940474245478,
                                          0.7200327656901061,
                                          0.8025573700139234,
                                          0.8702428712065159,
                                          0.4223003750624127,
                                          0.1074410804224426,
                                          0.3902887576702486,
                                          0.7686278406178223,
                                          0.4018098819435899,
                                          0.9702119168942321,
                                          0.7373843974158949,
                                          0.913378739973925,
                                          0.34114790713481635,
                                          0.5589204512553507,
                                          0.4303328844354496,
                                          0.2964625971077186,
                                          0.3768516801106607,
                                          0.7966622926398341,
                                          0.8151088765493302,
                                          0.5379149571200327,
                                          0.39072085218690344,
                                          0.9111009439807813,
                                          0.4226698209640033,
                                          0.5292444768122545,
                                          0.32618019582547464]);
        result.reshape(21, 5);

        let row_indices = vec![3, 3, 4, 3, 4, 0, 6, 3, 3, 6, 5, 3, 6, 3, 3, 2, 0, 2, 6, 1, 3];

        assert!(allclose(&arr.get_rows(&row_indices), &result));
    }



    #[test]
    fn test_scalar_add_0() {

        let mut arr = Array::from(vec![0.06811702594060087,
                                       0.0032471397228261978,
                                       0.5562333371936806,
                                       0.9348887679753367,
                                       0.2779799974915451,
                                       0.2840277318568395,
                                       0.05578500441875145,
                                       0.20069047841331833,
                                       0.8148074793579072,
                                       0.39323724045807107,
                                       0.8398094055020797,
                                       0.036468790331246725,
                                       0.6506392529438814,
                                       0.8673875170184757,
                                       0.8219330025814674,
                                       0.9186250940898061,
                                       0.19608298103170663,
                                       0.3817598767008713,
                                       0.954662525609448,
                                       0.3457412055584168,
                                       0.49403958483043986]);
        arr.reshape(3, 7);

        let mut result = Array::from(vec![0.39118270414807965,
                                          0.326312817930305,
                                          0.8792990154011594,
                                          1.2579544461828154,
                                          0.6010456756990239,
                                          0.6070934100643183,
                                          0.37885068262623023,
                                          0.5237561566207971,
                                          1.137873157565386,
                                          0.7163029186655498,
                                          1.1628750837095585,
                                          0.3595344685387255,
                                          0.9737049311513601,
                                          1.1904531952259545,
                                          1.1449986807889463,
                                          1.241690772297285,
                                          0.5191486592391854,
                                          0.7048255549083501,
                                          1.2777282038169266,
                                          0.6688068837658956,
                                          0.8171052630379186]);
        result.reshape(3, 7);

        let rhs = 0.323065678207;

        assert!(allclose(&(arr.add(rhs)), &result));

        arr.add_inplace(rhs);
        assert!(allclose(&(arr), &result));
    }



    #[test]
    fn test_scalar_add_1() {

        let mut arr = Array::from(vec![0.523554117221654,
                                       0.5405895625742049,
                                       0.2776740067914204,
                                       0.5515042893078336,
                                       0.31576747712868725,
                                       0.6246240875665414,
                                       0.9606289652790903,
                                       0.7784157928181845,
                                       0.5096025362838101,
                                       0.19050403548585448,
                                       0.06359843609825355,
                                       0.9920051273565584]);
        arr.reshape(2, 6);

        let mut result = Array::from(vec![1.2613960443050702,
                                          1.278431489657621,
                                          1.0155159338748367,
                                          1.28934621639125,
                                          1.0536094042121036,
                                          1.3624660146499576,
                                          1.6984708923625065,
                                          1.5162577199016007,
                                          1.2474444633672264,
                                          0.9283459625692707,
                                          0.8014403631816698,
                                          1.7298470544399747]);
        result.reshape(2, 6);

        let rhs = 0.737841927083;

        assert!(allclose(&(arr.add(rhs)), &result));

        arr.add_inplace(rhs);
        assert!(allclose(&(arr), &result));
    }



    #[test]
    fn test_scalar_add_2() {

        let mut arr = Array::from(vec![0.08370795679307508,
                                       0.7621734331141712,
                                       0.9562068294243001,
                                       0.22427242579832596,
                                       0.42277971497076405,
                                       0.18993578541966183,
                                       0.8966402386959843,
                                       0.5497714950340916,
                                       0.979407327448822,
                                       0.22505291801672678]);
        arr.reshape(5, 2);

        let mut result = Array::from(vec![-0.6928843447479325,
                                          -0.014418868426836373,
                                          0.17961452788329257,
                                          -0.5523198757426816,
                                          -0.3538125865702435,
                                          -0.5866565161213457,
                                          0.12004793715497675,
                                          -0.22682080650691594,
                                          0.20281502590781442,
                                          -0.5515393835242808]);
        result.reshape(5, 2);

        let rhs = -0.776592301541;

        assert!(allclose(&(arr.add(rhs)), &result));

        arr.add_inplace(rhs);
        assert!(allclose(&(arr), &result));
    }



    #[test]
    fn test_scalar_add_3() {

        let mut arr = Array::from(vec![0.4936907903068515,
                                       0.20194296368602416,
                                       0.3829007797075089,
                                       0.5640015695389897,
                                       0.778032931813845,
                                       0.20997168576500402,
                                       0.19074236652852994,
                                       0.31859275161178546]);
        arr.reshape(1, 8);

        let mut result = Array::from(vec![-0.3385239219948635,
                                          -0.6302717486156908,
                                          -0.44931393259420604,
                                          -0.26821314276272523,
                                          -0.054181780487869924,
                                          -0.6222430265367109,
                                          -0.641472345773185,
                                          -0.5136219606899295]);
        result.reshape(1, 8);

        let rhs = -0.832214712302;

        assert!(allclose(&(arr.add(rhs)), &result));

        arr.add_inplace(rhs);
        assert!(allclose(&(arr), &result));
    }



    #[test]
    fn test_scalar_add_4() {

        let mut arr = Array::from(vec![0.22856424898298544,
                                       0.31940267402449873,
                                       0.8887093921856027,
                                       0.19072686256910676,
                                       0.46462772784032014,
                                       0.08752074191367665,
                                       0.8546930292034037,
                                       0.022770779845259437]);
        arr.reshape(8, 1);

        let mut result = Array::from(vec![-0.3555348247285869,
                                          -0.2646963996870736,
                                          0.3046103184740304,
                                          -0.39337221114246557,
                                          -0.11947134587125219,
                                          -0.4965783317978957,
                                          0.2705939554918314,
                                          -0.5613282938663129]);
        result.reshape(8, 1);

        let rhs = -0.584099073712;

        assert!(allclose(&(arr.add(rhs)), &result));

        arr.add_inplace(rhs);
        assert!(allclose(&(arr), &result));
    }



    #[test]
    fn test_scalar_add_5() {

        let mut arr = Array::from(vec![0.9809205056841841,
                                       0.33299564214047805,
                                       0.7794303578945068,
                                       0.10485171110895442,
                                       0.41109205328440135,
                                       0.13965197006300867,
                                       0.8565358169677101,
                                       0.8431696666964094,
                                       0.6623608102945309,
                                       0.8895539806717817,
                                       0.6539035744899716,
                                       0.8889465311848584,
                                       0.4877182653207157,
                                       0.16435065364786217,
                                       0.8638084923944652,
                                       0.3213782661144825,
                                       0.5534350763775198,
                                       0.5720898040673107,
                                       0.04459127396247098,
                                       0.5895633328775719,
                                       0.9658090410489292,
                                       0.3534478214947444,
                                       0.5285776368934987,
                                       0.13445147873841157,
                                       0.36101860852519785,
                                       0.3343563716507818,
                                       0.363015951384304,
                                       0.584979662494934,
                                       0.9548274787099071,
                                       0.1075713091854591,
                                       0.2038098798210375,
                                       0.01140797599229293,
                                       0.08184250431205853,
                                       0.9042079612866117,
                                       0.8979491942667515,
                                       0.869373724494945,
                                       0.3538388463563201,
                                       0.4754988589174608,
                                       0.4694231674732119,
                                       0.1887409583134234,
                                       0.9148221048400892,
                                       0.6559195021254881,
                                       0.1897196903434769,
                                       0.7602151618545422,
                                       0.44835948468885367,
                                       0.7131453192939813,
                                       0.879632358051081,
                                       0.3493184807385423,
                                       0.7590567490943513,
                                       0.41898863180099055,
                                       0.548792375495095,
                                       0.704546184617159,
                                       0.7541363839955707,
                                       0.5848805009620869,
                                       0.5822557475310346,
                                       0.7146597150121486,
                                       0.2796232248768632,
                                       0.27467637251457966,
                                       0.06960804611156912,
                                       0.3593073709314968,
                                       0.8817491601357033,
                                       0.13658583253315493,
                                       0.2291696765983675]);
        arr.reshape(9, 7);

        let mut result = Array::from(vec![1.5866544112473009,
                                          0.9387295477035947,
                                          1.3851642634576233,
                                          0.7105856166720711,
                                          1.0168259588475181,
                                          0.7453858756261253,
                                          1.4622697225308268,
                                          1.448903572259526,
                                          1.2680947158576474,
                                          1.4952878862348984,
                                          1.2596374800530883,
                                          1.4946804367479751,
                                          1.0934521708838325,
                                          0.7700845592109788,
                                          1.469542397957582,
                                          0.9271121716775992,
                                          1.1591689819406366,
                                          1.1778237096304274,
                                          0.6503251795255877,
                                          1.1952972384406886,
                                          1.5715429466120459,
                                          0.9591817270578611,
                                          1.1343115424566155,
                                          0.7401853843015282,
                                          0.9667525140883145,
                                          0.9400902772138985,
                                          0.9687498569474207,
                                          1.1907135680580507,
                                          1.560561384273024,
                                          0.7133052147485758,
                                          0.8095437853841542,
                                          0.6171418815554096,
                                          0.6875764098751752,
                                          1.5099418668497284,
                                          1.503683099829868,
                                          1.4751076300580617,
                                          0.9595727519194368,
                                          1.0812327644805775,
                                          1.0751570730363285,
                                          0.7944748638765401,
                                          1.5205560104032059,
                                          1.2616534076886048,
                                          0.7954535959065936,
                                          1.3659490674176589,
                                          1.0540933902519702,
                                          1.318879224857098,
                                          1.4853662636141975,
                                          0.955052386301659,
                                          1.364790654657468,
                                          1.0247225373641071,
                                          1.1545262810582115,
                                          1.3102800901802758,
                                          1.3598702895586874,
                                          1.1906144065252036,
                                          1.1879896530941512,
                                          1.3203936205752653,
                                          0.8853571304399799,
                                          0.8804102780776963,
                                          0.6753419516746858,
                                          0.9650412764946135,
                                          1.4874830656988198,
                                          0.7423197380962716,
                                          0.8349035821614842]);
        result.reshape(9, 7);

        let rhs = 0.605733905563;

        assert!(allclose(&(arr.add(rhs)), &result));

        arr.add_inplace(rhs);
        assert!(allclose(&(arr), &result));
    }



    #[test]
    fn test_scalar_add_6() {

        let mut arr = Array::from(vec![0.6985484562924693,
                                       0.45624836780039457,
                                       0.2154741062034795,
                                       0.1941943611438679,
                                       0.9654363394193848,
                                       0.8242325296917633]);
        arr.reshape(6, 1);

        let mut result = Array::from(vec![0.7911678879366814,
                                          0.5488677994446066,
                                          0.30809353784769156,
                                          0.28681379278807995,
                                          1.058055771063597,
                                          0.9168519613359754]);
        result.reshape(6, 1);

        let rhs = 0.0926194316442;

        assert!(allclose(&(arr.add(rhs)), &result));

        arr.add_inplace(rhs);
        assert!(allclose(&(arr), &result));
    }



    #[test]
    fn test_scalar_add_7() {

        let mut arr = Array::from(vec![0.17364595662240045,
                                       0.7907920202091278,
                                       0.2062734698221016,
                                       0.9321037630582465,
                                       0.8049973740006956,
                                       0.1390513599284552,
                                       0.666894980732186,
                                       0.6837041938551661,
                                       0.22571750944930125,
                                       0.5397374300779394,
                                       0.03285953663228669,
                                       0.5551032080307319,
                                       0.1841128248076318,
                                       0.19843902091275567,
                                       0.7338783373618613,
                                       0.8422643621113209,
                                       0.47726124014639304,
                                       0.6353777538401215,
                                       0.7834161837208827,
                                       0.06576775345683428,
                                       0.3535972264171642,
                                       0.7335322528559519,
                                       0.6599711886078127,
                                       0.7547132773001621,
                                       0.4286641696259391,
                                       0.6448843452242246,
                                       0.10311468165230331,
                                       0.4455711553915871,
                                       0.41214572940218475,
                                       0.5320895529540762,
                                       0.583553426888169,
                                       0.6090282662471606,
                                       0.21001713013934487,
                                       0.6050812060055928,
                                       0.3236972496574251,
                                       0.31412388136935265,
                                       0.10581303071284542,
                                       0.3751722159246088,
                                       0.5249028685145385,
                                       0.7933697765126563,
                                       0.875907701559008,
                                       0.028364517270292988,
                                       0.3129619809852322,
                                       0.4360716921593736,
                                       0.2289188200282407,
                                       0.5463355515296112,
                                       0.38494710552778266,
                                       0.2405553425204674,
                                       0.4350503547556466,
                                       0.45577216951250654,
                                       0.3500071863552816,
                                       0.44845541886354634,
                                       0.8402537017145358,
                                       0.8380513354975876,
                                       0.45533315507777516,
                                       0.01823725565443879,
                                       0.5259951641359074,
                                       0.9316871781742284,
                                       0.9605882157757877,
                                       0.04843707069017311,
                                       0.7584795309163317,
                                       0.5272168156082075,
                                       0.7036476259040368,
                                       0.0770587560211834]);
        arr.reshape(8, 8);

        let mut result = Array::from(vec![-0.4744465994368886,
                                          0.1426994641498387,
                                          -0.44181908623718746,
                                          0.28401120699895743,
                                          0.15690481794140654,
                                          -0.5090411961308339,
                                          0.018802424672896945,
                                          0.03561163779587706,
                                          -0.4223750466099878,
                                          -0.10835512598134966,
                                          -0.6152330194270024,
                                          -0.09298934802855718,
                                          -0.46397973125165726,
                                          -0.4496535351465334,
                                          0.0857857813025722,
                                          0.19417180605203188,
                                          -0.17083131591289602,
                                          -0.012714802219167542,
                                          0.13532362766159367,
                                          -0.5823248026024548,
                                          -0.2944953296421249,
                                          0.08543969679666286,
                                          0.011878632548523615,
                                          0.10662072124087307,
                                          -0.21942838643334994,
                                          -0.0032082108350645067,
                                          -0.5449778744069858,
                                          -0.20252140066770197,
                                          -0.2359468266571043,
                                          -0.11600300310521283,
                                          -0.06453912917112004,
                                          -0.039064289812128505,
                                          -0.4380754259199442,
                                          -0.04301135005369627,
                                          -0.324395306401864,
                                          -0.3339686746899364,
                                          -0.5422795253464436,
                                          -0.27292034013468025,
                                          -0.12318968754475057,
                                          0.14527722045336722,
                                          0.22781514549971893,
                                          -0.6197280387889961,
                                          -0.33513057507405686,
                                          -0.21202086389991548,
                                          -0.41917373603104835,
                                          -0.10175700452967784,
                                          -0.2631454505315064,
                                          -0.40753721353882166,
                                          -0.2130422013036425,
                                          -0.19232038654678252,
                                          -0.29808536970400745,
                                          -0.19963713719574272,
                                          0.19216114565524678,
                                          0.18995877943829853,
                                          -0.1927594009815139,
                                          -0.6298553004048503,
                                          -0.12209739192338165,
                                          0.28359462211493935,
                                          0.3124956597164986,
                                          -0.599655485369116,
                                          0.11038697485704263,
                                          -0.12087574045108151,
                                          0.055555069844747784,
                                          -0.5710338000381057]);
        result.reshape(8, 8);

        let rhs = -0.648092556059;

        assert!(allclose(&(arr.add(rhs)), &result));

        arr.add_inplace(rhs);
        assert!(allclose(&(arr), &result));
    }



    #[test]
    fn test_scalar_add_8() {

        let mut arr = Array::from(vec![0.4586775356310824,
                                       0.7002204713703478,
                                       0.7720542543970859,
                                       0.40482805672049604,
                                       0.052510490259575326,
                                       0.5520571953870373,
                                       0.024234330544996685,
                                       0.9371264819462378,
                                       0.3871065053718359,
                                       0.6023738389993859,
                                       0.4191855284848276,
                                       0.38976817512649575,
                                       0.529572603026883,
                                       0.02759798631740329,
                                       0.8414849021852067,
                                       0.4506447780038211,
                                       0.38640241887503735,
                                       0.27673717320310187,
                                       0.5714286844965489,
                                       0.5450559026541721,
                                       0.9917249918774653,
                                       0.8408671512656238,
                                       0.987490588396677,
                                       0.9116079157193353]);
        arr.reshape(4, 6);

        let mut result = Array::from(vec![0.7424617741819709,
                                          0.9840047099212363,
                                          1.0558384929479745,
                                          0.6886122952713846,
                                          0.33629472881046385,
                                          0.8358414339379259,
                                          0.3080185690958852,
                                          1.2209107204971263,
                                          0.6708907439227244,
                                          0.8861580775502744,
                                          0.7029697670357161,
                                          0.6735524136773843,
                                          0.8133568415777715,
                                          0.3113822248682918,
                                          1.125269140736095,
                                          0.7344290165547096,
                                          0.6701866574259259,
                                          0.5605214117539904,
                                          0.8552129230474375,
                                          0.8288401412050607,
                                          1.2755092304283537,
                                          1.1246513898165125,
                                          1.2712748269475656,
                                          1.1953921542702237]);
        result.reshape(4, 6);

        let rhs = 0.283784238551;

        assert!(allclose(&(arr.add(rhs)), &result));

        arr.add_inplace(rhs);
        assert!(allclose(&(arr), &result));
    }



    #[test]
    fn test_scalar_add_9() {

        let mut arr = Array::from(vec![0.45179439717779746,
                                       0.9066582618309699,
                                       0.7072602829298359,
                                       0.7347636554252458]);
        arr.reshape(4, 1);

        let mut result = Array::from(vec![0.10681767302311318,
                                          0.5616815376762856,
                                          0.3622835587751516,
                                          0.3897869312705615]);
        result.reshape(4, 1);

        let rhs = -0.344976724155;

        assert!(allclose(&(arr.add(rhs)), &result));

        arr.add_inplace(rhs);
        assert!(allclose(&(arr), &result));
    }



    #[test]
    fn test_array_op_add_0() {

        let mut arr1 = Array::from(vec![0.5292374491691589,
                                        0.6942721605300903,
                                        0.7879465222358704,
                                        0.1940249502658844,
                                        0.9599275588989258,
                                        0.1508907526731491,
                                        0.21195031702518463,
                                        0.011483190581202507,
                                        0.7558361291885376,
                                        0.5654648542404175,
                                        0.8437381982803345,
                                        0.16252118349075317,
                                        0.5444399118423462,
                                        0.5924404263496399,
                                        0.5894774794578552,
                                        0.8173068165779114,
                                        0.4974719285964966,
                                        0.506263256072998,
                                        0.14057034254074097,
                                        0.1987122744321823,
                                        0.7811152338981628,
                                        0.9682057499885559,
                                        0.4419597387313843,
                                        0.9235113859176636,
                                        0.6840105652809143,
                                        0.0571264773607254,
                                        0.5038227438926697,
                                        0.5125789642333984,
                                        0.361473023891449,
                                        0.7799157500267029]);
        arr1.reshape(5, 6);

        let mut arr2 = Array::from(vec![0.4231114983558655,
                                        0.8525132536888123,
                                        0.6305864453315735,
                                        0.602831244468689,
                                        0.059981320053339005,
                                        0.8514574766159058,
                                        0.43011587858200073,
                                        0.7333865761756897,
                                        0.6444382071495056,
                                        0.5360978841781616,
                                        0.805327832698822,
                                        0.1458495855331421,
                                        0.36950308084487915,
                                        0.5650636553764343,
                                        0.017384890466928482,
                                        0.6433643698692322,
                                        0.48399919271469116,
                                        0.10224444419145584,
                                        0.2002507895231247,
                                        0.8062815070152283,
                                        0.8852312564849854,
                                        0.7486478090286255,
                                        0.7067756056785583,
                                        0.4174099862575531,
                                        0.9084565043449402,
                                        0.8913657069206238,
                                        0.9131410121917725,
                                        0.3868154287338257,
                                        0.010430347174406052,
                                        0.5083411931991577]);
        arr2.reshape(5, 6);

        let mut result = Array::from(vec![0.9523489475250244,
                                          1.5467853546142578,
                                          1.4185329675674438,
                                          0.796856164932251,
                                          1.0199089050292969,
                                          1.0023481845855713,
                                          0.6420661807060242,
                                          0.7448697686195374,
                                          1.4002742767333984,
                                          1.101562738418579,
                                          1.6490659713745117,
                                          0.30837076902389526,
                                          0.9139429926872253,
                                          1.1575040817260742,
                                          0.6068623661994934,
                                          1.4606711864471436,
                                          0.9814711213111877,
                                          0.6085076928138733,
                                          0.34082114696502686,
                                          1.0049937963485718,
                                          1.666346549987793,
                                          1.7168536186218262,
                                          1.1487352848052979,
                                          1.340921401977539,
                                          1.5924670696258545,
                                          0.948492169380188,
                                          1.416963815689087,
                                          0.8993943929672241,
                                          0.37190335988998413,
                                          1.2882568836212158]);
        result.reshape(5, 6);

        assert!(allclose(&arr1.add(&arr2), &result));

        arr1.add_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_sub_0() {

        let mut arr1 = Array::from(vec![0.5292374491691589,
                                        0.6942721605300903,
                                        0.7879465222358704,
                                        0.1940249502658844,
                                        0.9599275588989258,
                                        0.1508907526731491,
                                        0.21195031702518463,
                                        0.011483190581202507,
                                        0.7558361291885376,
                                        0.5654648542404175,
                                        0.8437381982803345,
                                        0.16252118349075317,
                                        0.5444399118423462,
                                        0.5924404263496399,
                                        0.5894774794578552,
                                        0.8173068165779114,
                                        0.4974719285964966,
                                        0.506263256072998,
                                        0.14057034254074097,
                                        0.1987122744321823,
                                        0.7811152338981628,
                                        0.9682057499885559,
                                        0.4419597387313843,
                                        0.9235113859176636,
                                        0.6840105652809143,
                                        0.0571264773607254,
                                        0.5038227438926697,
                                        0.5125789642333984,
                                        0.361473023891449,
                                        0.7799157500267029]);
        arr1.reshape(5, 6);

        let mut arr2 = Array::from(vec![0.4231114983558655,
                                        0.8525132536888123,
                                        0.6305864453315735,
                                        0.602831244468689,
                                        0.059981320053339005,
                                        0.8514574766159058,
                                        0.43011587858200073,
                                        0.7333865761756897,
                                        0.6444382071495056,
                                        0.5360978841781616,
                                        0.805327832698822,
                                        0.1458495855331421,
                                        0.36950308084487915,
                                        0.5650636553764343,
                                        0.017384890466928482,
                                        0.6433643698692322,
                                        0.48399919271469116,
                                        0.10224444419145584,
                                        0.2002507895231247,
                                        0.8062815070152283,
                                        0.8852312564849854,
                                        0.7486478090286255,
                                        0.7067756056785583,
                                        0.4174099862575531,
                                        0.9084565043449402,
                                        0.8913657069206238,
                                        0.9131410121917725,
                                        0.3868154287338257,
                                        0.010430347174406052,
                                        0.5083411931991577]);
        arr2.reshape(5, 6);

        let mut result = Array::from(vec![0.10612595081329346,
                                          -0.15824109315872192,
                                          0.15736007690429688,
                                          -0.40880629420280457,
                                          0.8999462127685547,
                                          -0.7005667090415955,
                                          -0.2181655615568161,
                                          -0.721903383731842,
                                          0.11139792203903198,
                                          0.02936697006225586,
                                          0.03841036558151245,
                                          0.016671597957611084,
                                          0.17493683099746704,
                                          0.027376770973205566,
                                          0.572092592716217,
                                          0.1739424467086792,
                                          0.01347273588180542,
                                          0.4040188193321228,
                                          -0.05968044698238373,
                                          -0.6075692176818848,
                                          -0.10411602258682251,
                                          0.21955794095993042,
                                          -0.2648158669471741,
                                          0.5061013698577881,
                                          -0.22444593906402588,
                                          -0.8342392444610596,
                                          -0.4093182682991028,
                                          0.12576353549957275,
                                          0.3510426878929138,
                                          0.27157455682754517]);
        result.reshape(5, 6);

        assert!(allclose(&arr1.sub(&arr2), &result));

        arr1.sub_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_times_0() {

        let mut arr1 = Array::from(vec![0.5292374491691589,
                                        0.6942721605300903,
                                        0.7879465222358704,
                                        0.1940249502658844,
                                        0.9599275588989258,
                                        0.1508907526731491,
                                        0.21195031702518463,
                                        0.011483190581202507,
                                        0.7558361291885376,
                                        0.5654648542404175,
                                        0.8437381982803345,
                                        0.16252118349075317,
                                        0.5444399118423462,
                                        0.5924404263496399,
                                        0.5894774794578552,
                                        0.8173068165779114,
                                        0.4974719285964966,
                                        0.506263256072998,
                                        0.14057034254074097,
                                        0.1987122744321823,
                                        0.7811152338981628,
                                        0.9682057499885559,
                                        0.4419597387313843,
                                        0.9235113859176636,
                                        0.6840105652809143,
                                        0.0571264773607254,
                                        0.5038227438926697,
                                        0.5125789642333984,
                                        0.361473023891449,
                                        0.7799157500267029]);
        arr1.reshape(5, 6);

        let mut arr2 = Array::from(vec![0.4231114983558655,
                                        0.8525132536888123,
                                        0.6305864453315735,
                                        0.602831244468689,
                                        0.059981320053339005,
                                        0.8514574766159058,
                                        0.43011587858200073,
                                        0.7333865761756897,
                                        0.6444382071495056,
                                        0.5360978841781616,
                                        0.805327832698822,
                                        0.1458495855331421,
                                        0.36950308084487915,
                                        0.5650636553764343,
                                        0.017384890466928482,
                                        0.6433643698692322,
                                        0.48399919271469116,
                                        0.10224444419145584,
                                        0.2002507895231247,
                                        0.8062815070152283,
                                        0.8852312564849854,
                                        0.7486478090286255,
                                        0.7067756056785583,
                                        0.4174099862575531,
                                        0.9084565043449402,
                                        0.8913657069206238,
                                        0.9131410121917725,
                                        0.3868154287338257,
                                        0.010430347174406052,
                                        0.5083411931991577]);
        arr2.reshape(5, 6);

        let mut result = Array::from(vec![0.22392645478248596,
                                          0.591876208782196,
                                          0.49686840176582336,
                                          0.11696430295705795,
                                          0.057577721774578094,
                                          0.1284770667552948,
                                          0.09116319566965103,
                                          0.008421617560088634,
                                          0.48708969354629517,
                                          0.30314451456069946,
                                          0.6794858574867249,
                                          0.023703647777438164,
                                          0.20117221772670746,
                                          0.33476656675338745,
                                          0.010248001664876938,
                                          0.525826096534729,
                                          0.24077601730823517,
                                          0.05176260694861412,
                                          0.028149321675300598,
                                          0.1602180302143097,
                                          0.6914676427841187,
                                          0.7248451113700867,
                                          0.3123663663864136,
                                          0.38548287749290466,
                                          0.6213938593864441,
                                          0.05092058330774307,
                                          0.4600612223148346,
                                          0.1982734501361847,
                                          0.003770289244130254,
                                          0.3964633047580719]);
        result.reshape(5, 6);

        assert!(allclose(&arr1.times(&arr2), &result));

        arr1.times_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_div_0() {

        let mut arr1 = Array::from(vec![0.5292374491691589,
                                        0.6942721605300903,
                                        0.7879465222358704,
                                        0.1940249502658844,
                                        0.9599275588989258,
                                        0.1508907526731491,
                                        0.21195031702518463,
                                        0.011483190581202507,
                                        0.7558361291885376,
                                        0.5654648542404175,
                                        0.8437381982803345,
                                        0.16252118349075317,
                                        0.5444399118423462,
                                        0.5924404263496399,
                                        0.5894774794578552,
                                        0.8173068165779114,
                                        0.4974719285964966,
                                        0.506263256072998,
                                        0.14057034254074097,
                                        0.1987122744321823,
                                        0.7811152338981628,
                                        0.9682057499885559,
                                        0.4419597387313843,
                                        0.9235113859176636,
                                        0.6840105652809143,
                                        0.0571264773607254,
                                        0.5038227438926697,
                                        0.5125789642333984,
                                        0.361473023891449,
                                        0.7799157500267029]);
        arr1.reshape(5, 6);

        let mut arr2 = Array::from(vec![0.4231114983558655,
                                        0.8525132536888123,
                                        0.6305864453315735,
                                        0.602831244468689,
                                        0.059981320053339005,
                                        0.8514574766159058,
                                        0.43011587858200073,
                                        0.7333865761756897,
                                        0.6444382071495056,
                                        0.5360978841781616,
                                        0.805327832698822,
                                        0.1458495855331421,
                                        0.36950308084487915,
                                        0.5650636553764343,
                                        0.017384890466928482,
                                        0.6433643698692322,
                                        0.48399919271469116,
                                        0.10224444419145584,
                                        0.2002507895231247,
                                        0.8062815070152283,
                                        0.8852312564849854,
                                        0.7486478090286255,
                                        0.7067756056785583,
                                        0.4174099862575531,
                                        0.9084565043449402,
                                        0.8913657069206238,
                                        0.9131410121917725,
                                        0.3868154287338257,
                                        0.010430347174406052,
                                        0.5083411931991577]);
        arr2.reshape(5, 6);

        let mut result = Array::from(vec![1.25082266330719,
                                          0.8143828511238098,
                                          1.2495455741882324,
                                          0.32185617089271545,
                                          16.003774642944336,
                                          0.17721466720104218,
                                          0.4927749037742615,
                                          0.015657760202884674,
                                          1.1728605031967163,
                                          1.0547791719436646,
                                          1.047695279121399,
                                          1.1143068075180054,
                                          1.4734381437301636,
                                          1.0484490394592285,
                                          33.9074592590332,
                                          1.2703638076782227,
                                          1.0278363227844238,
                                          4.951498985290527,
                                          0.7019714713096619,
                                          0.24645520746707916,
                                          0.8823854923248291,
                                          1.293272614479065,
                                          0.6253183484077454,
                                          2.212480306625366,
                                          0.7529370784759521,
                                          0.06408870965242386,
                                          0.5517469048500061,
                                          1.3251254558563232,
                                          34.6558952331543,
                                          1.5342367887496948]);
        result.reshape(5, 6);

        assert!(allclose(&arr1.div(&arr2), &result));

        arr1.div_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_add_1() {

        let mut arr1 = Array::from(vec![0.8881012797355652,
                                        0.29694488644599915,
                                        0.3035637438297272,
                                        0.46961191296577454,
                                        0.7102128863334656,
                                        0.7828819751739502,
                                        0.7689284682273865,
                                        0.9182071089744568]);
        arr1.reshape(1, 8);

        let mut arr2 = Array::from(vec![0.7185758352279663,
                                        0.09909920394420624,
                                        0.4448649287223816,
                                        0.47341388463974,
                                        0.5639866590499878,
                                        0.6206879019737244,
                                        0.07192548364400864,
                                        0.9532538652420044]);
        arr2.reshape(1, 8);

        let mut result = Array::from(vec![1.6066770553588867,
                                          0.3960440754890442,
                                          0.7484287023544312,
                                          0.9430258274078369,
                                          1.2741994857788086,
                                          1.4035699367523193,
                                          0.8408539295196533,
                                          1.8714609146118164]);
        result.reshape(1, 8);

        assert!(allclose(&arr1.add(&arr2), &result));

        arr1.add_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_sub_1() {

        let mut arr1 = Array::from(vec![0.8881012797355652,
                                        0.29694488644599915,
                                        0.3035637438297272,
                                        0.46961191296577454,
                                        0.7102128863334656,
                                        0.7828819751739502,
                                        0.7689284682273865,
                                        0.9182071089744568]);
        arr1.reshape(1, 8);

        let mut arr2 = Array::from(vec![0.7185758352279663,
                                        0.09909920394420624,
                                        0.4448649287223816,
                                        0.47341388463974,
                                        0.5639866590499878,
                                        0.6206879019737244,
                                        0.07192548364400864,
                                        0.9532538652420044]);
        arr2.reshape(1, 8);

        let mut result = Array::from(vec![0.16952544450759888,
                                          0.1978456825017929,
                                          -0.14130118489265442,
                                          -0.003801971673965454,
                                          0.14622622728347778,
                                          0.16219407320022583,
                                          0.6970030069351196,
                                          -0.03504675626754761]);
        result.reshape(1, 8);

        assert!(allclose(&arr1.sub(&arr2), &result));

        arr1.sub_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_times_1() {

        let mut arr1 = Array::from(vec![0.8881012797355652,
                                        0.29694488644599915,
                                        0.3035637438297272,
                                        0.46961191296577454,
                                        0.7102128863334656,
                                        0.7828819751739502,
                                        0.7689284682273865,
                                        0.9182071089744568]);
        arr1.reshape(1, 8);

        let mut arr2 = Array::from(vec![0.7185758352279663,
                                        0.09909920394420624,
                                        0.4448649287223816,
                                        0.47341388463974,
                                        0.5639866590499878,
                                        0.6206879019737244,
                                        0.07192548364400864,
                                        0.9532538652420044]);
        arr2.reshape(1, 8);

        let mut result = Array::from(vec![0.6381680965423584,
                                          0.029427001252770424,
                                          0.1350448578596115,
                                          0.2223207950592041,
                                          0.40055060386657715,
                                          0.4859253764152527,
                                          0.05530555173754692,
                                          0.8752844929695129]);
        result.reshape(1, 8);

        assert!(allclose(&arr1.times(&arr2), &result));

        arr1.times_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_div_1() {

        let mut arr1 = Array::from(vec![0.8881012797355652,
                                        0.29694488644599915,
                                        0.3035637438297272,
                                        0.46961191296577454,
                                        0.7102128863334656,
                                        0.7828819751739502,
                                        0.7689284682273865,
                                        0.9182071089744568]);
        arr1.reshape(1, 8);

        let mut arr2 = Array::from(vec![0.7185758352279663,
                                        0.09909920394420624,
                                        0.4448649287223816,
                                        0.47341388463974,
                                        0.5639866590499878,
                                        0.6206879019737244,
                                        0.07192548364400864,
                                        0.9532538652420044]);
        arr2.reshape(1, 8);

        let mut result = Array::from(vec![1.235918641090393,
                                          2.9964406490325928,
                                          0.6823728084564209,
                                          0.9919690489768982,
                                          1.2592724561691284,
                                          1.2613134384155273,
                                          10.69062614440918,
                                          0.9632346034049988]);
        result.reshape(1, 8);

        assert!(allclose(&arr1.div(&arr2), &result));

        arr1.div_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_add_2() {

        let mut arr1 =
            Array::from(vec![0.18118929862976074, 0.03301256150007248, 0.40168774127960205]);
        arr1.reshape(3, 1);

        let mut arr2 =
            Array::from(vec![0.8023808002471924, 0.3789193034172058, 0.4163742959499359]);
        arr2.reshape(3, 1);

        let mut result =
            Array::from(vec![0.9835700988769531, 0.4119318723678589, 0.8180620670318604]);
        result.reshape(3, 1);

        assert!(allclose(&arr1.add(&arr2), &result));

        arr1.add_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_sub_2() {

        let mut arr1 =
            Array::from(vec![0.18118929862976074, 0.03301256150007248, 0.40168774127960205]);
        arr1.reshape(3, 1);

        let mut arr2 =
            Array::from(vec![0.8023808002471924, 0.3789193034172058, 0.4163742959499359]);
        arr2.reshape(3, 1);

        let mut result =
            Array::from(vec![-0.6211915016174316, -0.34590673446655273, -0.014686554670333862]);
        result.reshape(3, 1);

        assert!(allclose(&arr1.sub(&arr2), &result));

        arr1.sub_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_times_2() {

        let mut arr1 =
            Array::from(vec![0.18118929862976074, 0.03301256150007248, 0.40168774127960205]);
        arr1.reshape(3, 1);

        let mut arr2 =
            Array::from(vec![0.8023808002471924, 0.3789193034172058, 0.4163742959499359]);
        arr2.reshape(3, 1);

        let mut result =
            Array::from(vec![0.145382821559906, 0.012509096413850784, 0.16725245118141174]);
        result.reshape(3, 1);

        assert!(allclose(&arr1.times(&arr2), &result));

        arr1.times_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_div_2() {

        let mut arr1 =
            Array::from(vec![0.18118929862976074, 0.03301256150007248, 0.40168774127960205]);
        arr1.reshape(3, 1);

        let mut arr2 =
            Array::from(vec![0.8023808002471924, 0.3789193034172058, 0.4163742959499359]);
        arr2.reshape(3, 1);

        let mut result =
            Array::from(vec![0.2258145958185196, 0.08712293207645416, 0.964727520942688]);
        result.reshape(3, 1);

        assert!(allclose(&arr1.div(&arr2), &result));

        arr1.div_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_add_3() {

        let mut arr1 = Array::from(vec![0.4638933837413788,
                                        0.5166852474212646,
                                        0.6040269136428833,
                                        0.48605096340179443,
                                        0.9754371643066406,
                                        0.09661200642585754,
                                        0.5302534699440002,
                                        0.16749703884124756,
                                        0.51143479347229,
                                        0.8663506507873535,
                                        0.10709835588932037,
                                        0.915748119354248,
                                        0.4255952835083008,
                                        0.26459333300590515,
                                        0.526462972164154,
                                        0.7321544885635376,
                                        0.40716248750686646,
                                        0.13814333081245422,
                                        0.4818677008152008,
                                        0.7770387530326843,
                                        0.2103804051876068,
                                        0.004492859821766615,
                                        0.7736490368843079,
                                        0.11656702309846878,
                                        0.9824181199073792,
                                        0.6940855979919434,
                                        0.1370224505662918,
                                        0.46714478731155396,
                                        0.5641428828239441,
                                        0.4161204695701599,
                                        0.8921078443527222,
                                        0.3001706004142761,
                                        0.2636280953884125,
                                        0.5209411382675171,
                                        0.7548863887786865,
                                        0.8441078066825867,
                                        0.8554396629333496,
                                        0.034851253032684326,
                                        0.8351829648017883,
                                        0.8715921640396118]);
        arr1.reshape(8, 5);

        let mut arr2 = Array::from(vec![0.4195884168148041,
                                        0.5114026665687561,
                                        0.2934894561767578,
                                        0.2409084439277649,
                                        0.4596225917339325,
                                        0.4888952672481537,
                                        0.6638343334197998,
                                        0.388359934091568,
                                        0.46549633145332336,
                                        0.5773903727531433,
                                        0.03631483390927315,
                                        0.9943253993988037,
                                        0.0273441094905138,
                                        0.020947275683283806,
                                        0.31343042850494385,
                                        0.07427830994129181,
                                        0.19509199261665344,
                                        0.1998319774866104,
                                        0.20672959089279175,
                                        0.3237887918949127,
                                        0.28872179985046387,
                                        0.36704495549201965,
                                        0.3148595988750458,
                                        0.8327291011810303,
                                        0.9654577374458313,
                                        0.9463678002357483,
                                        0.48835742473602295,
                                        0.9109439253807068,
                                        0.030691994354128838,
                                        0.9641919732093811,
                                        0.43064993619918823,
                                        0.446991503238678,
                                        0.2768392860889435,
                                        0.8910713791847229,
                                        0.23636873066425323,
                                        0.8908159136772156,
                                        0.7293870449066162,
                                        0.2140239179134369,
                                        0.7874829173088074,
                                        0.8699233531951904]);
        arr2.reshape(8, 5);

        let mut result = Array::from(vec![0.8834818005561829,
                                          1.028087854385376,
                                          0.8975163698196411,
                                          0.7269594073295593,
                                          1.4350597858428955,
                                          0.5855072736740112,
                                          1.1940877437591553,
                                          0.5558569431304932,
                                          0.976931095123291,
                                          1.4437410831451416,
                                          0.14341318607330322,
                                          1.9100735187530518,
                                          0.45293939113616943,
                                          0.2855406105518341,
                                          0.8398934006690979,
                                          0.8064327836036682,
                                          0.6022545099258423,
                                          0.33797532320022583,
                                          0.6885973215103149,
                                          1.1008275747299194,
                                          0.4991022050380707,
                                          0.37153780460357666,
                                          1.0885086059570312,
                                          0.9492961168289185,
                                          1.9478758573532104,
                                          1.6404533386230469,
                                          0.6253798604011536,
                                          1.3780887126922607,
                                          0.5948348641395569,
                                          1.380312442779541,
                                          1.3227577209472656,
                                          0.7471621036529541,
                                          0.540467381477356,
                                          1.4120125770568848,
                                          0.9912551045417786,
                                          1.7349237203598022,
                                          1.5848267078399658,
                                          0.24887517094612122,
                                          1.6226658821105957,
                                          1.7415155172348022]);
        result.reshape(8, 5);

        assert!(allclose(&arr1.add(&arr2), &result));

        arr1.add_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_sub_3() {

        let mut arr1 = Array::from(vec![0.4638933837413788,
                                        0.5166852474212646,
                                        0.6040269136428833,
                                        0.48605096340179443,
                                        0.9754371643066406,
                                        0.09661200642585754,
                                        0.5302534699440002,
                                        0.16749703884124756,
                                        0.51143479347229,
                                        0.8663506507873535,
                                        0.10709835588932037,
                                        0.915748119354248,
                                        0.4255952835083008,
                                        0.26459333300590515,
                                        0.526462972164154,
                                        0.7321544885635376,
                                        0.40716248750686646,
                                        0.13814333081245422,
                                        0.4818677008152008,
                                        0.7770387530326843,
                                        0.2103804051876068,
                                        0.004492859821766615,
                                        0.7736490368843079,
                                        0.11656702309846878,
                                        0.9824181199073792,
                                        0.6940855979919434,
                                        0.1370224505662918,
                                        0.46714478731155396,
                                        0.5641428828239441,
                                        0.4161204695701599,
                                        0.8921078443527222,
                                        0.3001706004142761,
                                        0.2636280953884125,
                                        0.5209411382675171,
                                        0.7548863887786865,
                                        0.8441078066825867,
                                        0.8554396629333496,
                                        0.034851253032684326,
                                        0.8351829648017883,
                                        0.8715921640396118]);
        arr1.reshape(8, 5);

        let mut arr2 = Array::from(vec![0.4195884168148041,
                                        0.5114026665687561,
                                        0.2934894561767578,
                                        0.2409084439277649,
                                        0.4596225917339325,
                                        0.4888952672481537,
                                        0.6638343334197998,
                                        0.388359934091568,
                                        0.46549633145332336,
                                        0.5773903727531433,
                                        0.03631483390927315,
                                        0.9943253993988037,
                                        0.0273441094905138,
                                        0.020947275683283806,
                                        0.31343042850494385,
                                        0.07427830994129181,
                                        0.19509199261665344,
                                        0.1998319774866104,
                                        0.20672959089279175,
                                        0.3237887918949127,
                                        0.28872179985046387,
                                        0.36704495549201965,
                                        0.3148595988750458,
                                        0.8327291011810303,
                                        0.9654577374458313,
                                        0.9463678002357483,
                                        0.48835742473602295,
                                        0.9109439253807068,
                                        0.030691994354128838,
                                        0.9641919732093811,
                                        0.43064993619918823,
                                        0.446991503238678,
                                        0.2768392860889435,
                                        0.8910713791847229,
                                        0.23636873066425323,
                                        0.8908159136772156,
                                        0.7293870449066162,
                                        0.2140239179134369,
                                        0.7874829173088074,
                                        0.8699233531951904]);
        arr2.reshape(8, 5);

        let mut result = Array::from(vec![0.04430496692657471,
                                          0.005282580852508545,
                                          0.3105374574661255,
                                          0.24514251947402954,
                                          0.5158145427703857,
                                          -0.39228326082229614,
                                          -0.13358086347579956,
                                          -0.22086289525032043,
                                          0.045938462018966675,
                                          0.2889602780342102,
                                          0.07078352570533752,
                                          -0.07857728004455566,
                                          0.39825117588043213,
                                          0.2436460554599762,
                                          0.2130325436592102,
                                          0.657876193523407,
                                          0.212070494890213,
                                          -0.06168864667415619,
                                          0.27513810992240906,
                                          0.4532499611377716,
                                          -0.07834139466285706,
                                          -0.36255210638046265,
                                          0.4587894380092621,
                                          -0.7161620855331421,
                                          0.01696038246154785,
                                          -0.25228220224380493,
                                          -0.35133498907089233,
                                          -0.44379913806915283,
                                          0.5334509015083313,
                                          -0.5480715036392212,
                                          0.46145790815353394,
                                          -0.14682090282440186,
                                          -0.013211190700531006,
                                          -0.3701302409172058,
                                          0.5185176730155945,
                                          -0.046708106994628906,
                                          0.1260526180267334,
                                          -0.17917266488075256,
                                          0.04770004749298096,
                                          0.0016688108444213867]);
        result.reshape(8, 5);

        assert!(allclose(&arr1.sub(&arr2), &result));

        arr1.sub_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_times_3() {

        let mut arr1 = Array::from(vec![0.4638933837413788,
                                        0.5166852474212646,
                                        0.6040269136428833,
                                        0.48605096340179443,
                                        0.9754371643066406,
                                        0.09661200642585754,
                                        0.5302534699440002,
                                        0.16749703884124756,
                                        0.51143479347229,
                                        0.8663506507873535,
                                        0.10709835588932037,
                                        0.915748119354248,
                                        0.4255952835083008,
                                        0.26459333300590515,
                                        0.526462972164154,
                                        0.7321544885635376,
                                        0.40716248750686646,
                                        0.13814333081245422,
                                        0.4818677008152008,
                                        0.7770387530326843,
                                        0.2103804051876068,
                                        0.004492859821766615,
                                        0.7736490368843079,
                                        0.11656702309846878,
                                        0.9824181199073792,
                                        0.6940855979919434,
                                        0.1370224505662918,
                                        0.46714478731155396,
                                        0.5641428828239441,
                                        0.4161204695701599,
                                        0.8921078443527222,
                                        0.3001706004142761,
                                        0.2636280953884125,
                                        0.5209411382675171,
                                        0.7548863887786865,
                                        0.8441078066825867,
                                        0.8554396629333496,
                                        0.034851253032684326,
                                        0.8351829648017883,
                                        0.8715921640396118]);
        arr1.reshape(8, 5);

        let mut arr2 = Array::from(vec![0.4195884168148041,
                                        0.5114026665687561,
                                        0.2934894561767578,
                                        0.2409084439277649,
                                        0.4596225917339325,
                                        0.4888952672481537,
                                        0.6638343334197998,
                                        0.388359934091568,
                                        0.46549633145332336,
                                        0.5773903727531433,
                                        0.03631483390927315,
                                        0.9943253993988037,
                                        0.0273441094905138,
                                        0.020947275683283806,
                                        0.31343042850494385,
                                        0.07427830994129181,
                                        0.19509199261665344,
                                        0.1998319774866104,
                                        0.20672959089279175,
                                        0.3237887918949127,
                                        0.28872179985046387,
                                        0.36704495549201965,
                                        0.3148595988750458,
                                        0.8327291011810303,
                                        0.9654577374458313,
                                        0.9463678002357483,
                                        0.48835742473602295,
                                        0.9109439253807068,
                                        0.030691994354128838,
                                        0.9641919732093811,
                                        0.43064993619918823,
                                        0.446991503238678,
                                        0.2768392860889435,
                                        0.8910713791847229,
                                        0.23636873066425323,
                                        0.8908159136772156,
                                        0.7293870449066162,
                                        0.2140239179134369,
                                        0.7874829173088074,
                                        0.8699233531951904]);
        arr2.reshape(8, 5);

        let mut result = Array::from(vec![0.1946442872285843,
                                          0.2642342150211334,
                                          0.17727552354335785,
                                          0.1170937791466713,
                                          0.4483329653739929,
                                          0.04723315313458443,
                                          0.3520004451274872,
                                          0.06504914164543152,
                                          0.2380710244178772,
                                          0.5002225041389465,
                                          0.003889258950948715,
                                          0.9105516076087952,
                                          0.011637523770332336,
                                          0.0055425092577934265,
                                          0.1650095134973526,
                                          0.05438319966197014,
                                          0.07943414151668549,
                                          0.027605455368757248,
                                          0.09961631149053574,
                                          0.25159645080566406,
                                          0.06074140965938568,
                                          0.0016490815905854106,
                                          0.2435908317565918,
                                          0.09706874936819077,
                                          0.9484831690788269,
                                          0.6568602323532104,
                                          0.06691592931747437,
                                          0.4255427122116089,
                                          0.017314670607447624,
                                          0.40122002363204956,
                                          0.38418617844581604,
                                          0.1341737061738968,
                                          0.07298261672258377,
                                          0.46419572830200195,
                                          0.17843154072761536,
                                          0.7519446611404419,
                                          0.6239466071128845,
                                          0.007459001615643501,
                                          0.6576923131942749,
                                          0.7582184076309204]);
        result.reshape(8, 5);

        assert!(allclose(&arr1.times(&arr2), &result));

        arr1.times_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_div_3() {

        let mut arr1 = Array::from(vec![0.4638933837413788,
                                        0.5166852474212646,
                                        0.6040269136428833,
                                        0.48605096340179443,
                                        0.9754371643066406,
                                        0.09661200642585754,
                                        0.5302534699440002,
                                        0.16749703884124756,
                                        0.51143479347229,
                                        0.8663506507873535,
                                        0.10709835588932037,
                                        0.915748119354248,
                                        0.4255952835083008,
                                        0.26459333300590515,
                                        0.526462972164154,
                                        0.7321544885635376,
                                        0.40716248750686646,
                                        0.13814333081245422,
                                        0.4818677008152008,
                                        0.7770387530326843,
                                        0.2103804051876068,
                                        0.004492859821766615,
                                        0.7736490368843079,
                                        0.11656702309846878,
                                        0.9824181199073792,
                                        0.6940855979919434,
                                        0.1370224505662918,
                                        0.46714478731155396,
                                        0.5641428828239441,
                                        0.4161204695701599,
                                        0.8921078443527222,
                                        0.3001706004142761,
                                        0.2636280953884125,
                                        0.5209411382675171,
                                        0.7548863887786865,
                                        0.8441078066825867,
                                        0.8554396629333496,
                                        0.034851253032684326,
                                        0.8351829648017883,
                                        0.8715921640396118]);
        arr1.reshape(8, 5);

        let mut arr2 = Array::from(vec![0.4195884168148041,
                                        0.5114026665687561,
                                        0.2934894561767578,
                                        0.2409084439277649,
                                        0.4596225917339325,
                                        0.4888952672481537,
                                        0.6638343334197998,
                                        0.388359934091568,
                                        0.46549633145332336,
                                        0.5773903727531433,
                                        0.03631483390927315,
                                        0.9943253993988037,
                                        0.0273441094905138,
                                        0.020947275683283806,
                                        0.31343042850494385,
                                        0.07427830994129181,
                                        0.19509199261665344,
                                        0.1998319774866104,
                                        0.20672959089279175,
                                        0.3237887918949127,
                                        0.28872179985046387,
                                        0.36704495549201965,
                                        0.3148595988750458,
                                        0.8327291011810303,
                                        0.9654577374458313,
                                        0.9463678002357483,
                                        0.48835742473602295,
                                        0.9109439253807068,
                                        0.030691994354128838,
                                        0.9641919732093811,
                                        0.43064993619918823,
                                        0.446991503238678,
                                        0.2768392860889435,
                                        0.8910713791847229,
                                        0.23636873066425323,
                                        0.8908159136772156,
                                        0.7293870449066162,
                                        0.2140239179134369,
                                        0.7874829173088074,
                                        0.8699233531951904]);
        arr2.reshape(8, 5);

        let mut result = Array::from(vec![1.1055915355682373,
                                          1.0103296041488647,
                                          2.0580873489379883,
                                          2.01757550239563,
                                          2.1222567558288574,
                                          0.19761289656162262,
                                          0.7987737655639648,
                                          0.4312933087348938,
                                          1.0986870527267456,
                                          1.50045907497406,
                                          2.949162721633911,
                                          0.9209742546081543,
                                          15.564422607421875,
                                          12.631396293640137,
                                          1.6796804666519165,
                                          9.856907844543457,
                                          2.0870282649993896,
                                          0.6912974119186401,
                                          2.3309082984924316,
                                          2.399832248687744,
                                          0.728661298751831,
                                          0.012240624986588955,
                                          2.4571237564086914,
                                          0.1399819254875183,
                                          1.0175671577453613,
                                          0.7334205508232117,
                                          0.2805781960487366,
                                          0.5128139853477478,
                                          18.380783081054688,
                                          0.431574285030365,
                                          2.071538209915161,
                                          0.6715353727340698,
                                          0.9522784948348999,
                                          0.5846233367919922,
                                          3.193681240081787,
                                          0.9475670456886292,
                                          1.172819972038269,
                                          0.16283811628818512,
                                          1.0605727434158325,
                                          1.0019183158874512]);
        result.reshape(8, 5);

        assert!(allclose(&arr1.div(&arr2), &result));

        arr1.div_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_add_4() {

        let mut arr1 = Array::from(vec![0.7055813670158386,
                                        0.049010876566171646,
                                        0.1050436869263649,
                                        0.9104152321815491,
                                        0.10784147679805756,
                                        0.5316178798675537]);
        arr1.reshape(3, 2);

        let mut arr2 = Array::from(vec![0.1656838208436966,
                                        0.7906498908996582,
                                        0.4941992461681366,
                                        0.9727036952972412,
                                        0.6521415114402771,
                                        0.9028323292732239]);
        arr2.reshape(3, 2);

        let mut result = Array::from(vec![0.871265172958374,
                                          0.8396607637405396,
                                          0.5992429256439209,
                                          1.8831188678741455,
                                          0.7599830031394958,
                                          1.4344501495361328]);
        result.reshape(3, 2);

        assert!(allclose(&arr1.add(&arr2), &result));

        arr1.add_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_sub_4() {

        let mut arr1 = Array::from(vec![0.7055813670158386,
                                        0.049010876566171646,
                                        0.1050436869263649,
                                        0.9104152321815491,
                                        0.10784147679805756,
                                        0.5316178798675537]);
        arr1.reshape(3, 2);

        let mut arr2 = Array::from(vec![0.1656838208436966,
                                        0.7906498908996582,
                                        0.4941992461681366,
                                        0.9727036952972412,
                                        0.6521415114402771,
                                        0.9028323292732239]);
        arr2.reshape(3, 2);

        let mut result = Array::from(vec![0.5398975610733032,
                                          -0.7416390180587769,
                                          -0.3891555666923523,
                                          -0.06228846311569214,
                                          -0.5443000197410583,
                                          -0.37121444940567017]);
        result.reshape(3, 2);

        assert!(allclose(&arr1.sub(&arr2), &result));

        arr1.sub_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_times_4() {

        let mut arr1 = Array::from(vec![0.7055813670158386,
                                        0.049010876566171646,
                                        0.1050436869263649,
                                        0.9104152321815491,
                                        0.10784147679805756,
                                        0.5316178798675537]);
        arr1.reshape(3, 2);

        let mut arr2 = Array::from(vec![0.1656838208436966,
                                        0.7906498908996582,
                                        0.4941992461681366,
                                        0.9727036952972412,
                                        0.6521415114402771,
                                        0.9028323292732239]);
        arr2.reshape(3, 2);

        let mut result = Array::from(vec![0.11690341681241989,
                                          0.03875044360756874,
                                          0.05191251263022423,
                                          0.8855642676353455,
                                          0.07032790035009384,
                                          0.4799618124961853]);
        result.reshape(3, 2);

        assert!(allclose(&arr1.times(&arr2), &result));

        arr1.times_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_div_4() {

        let mut arr1 = Array::from(vec![0.7055813670158386,
                                        0.049010876566171646,
                                        0.1050436869263649,
                                        0.9104152321815491,
                                        0.10784147679805756,
                                        0.5316178798675537]);
        arr1.reshape(3, 2);

        let mut arr2 = Array::from(vec![0.1656838208436966,
                                        0.7906498908996582,
                                        0.4941992461681366,
                                        0.9727036952972412,
                                        0.6521415114402771,
                                        0.9028323292732239]);
        arr2.reshape(3, 2);

        let mut result = Array::from(vec![4.258601665496826,
                                          0.061988089233636856,
                                          0.21255330741405487,
                                          0.9359635710716248,
                                          0.16536514461040497,
                                          0.5888334512710571]);
        result.reshape(3, 2);

        assert!(allclose(&arr1.div(&arr2), &result));

        arr1.div_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_add_5() {

        let mut arr1 =
            Array::from(vec![0.9063590168952942, 0.42833206057548523, 0.2654511630535126]);
        arr1.reshape(1, 3);

        let mut arr2 =
            Array::from(vec![0.9844111800193787, 0.9482954144477844, 0.5508551597595215]);
        arr2.reshape(1, 3);

        let mut result =
            Array::from(vec![1.8907701969146729, 1.3766274452209473, 0.8163063526153564]);
        result.reshape(1, 3);

        assert!(allclose(&arr1.add(&arr2), &result));

        arr1.add_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_sub_5() {

        let mut arr1 =
            Array::from(vec![0.9063590168952942, 0.42833206057548523, 0.2654511630535126]);
        arr1.reshape(1, 3);

        let mut arr2 =
            Array::from(vec![0.9844111800193787, 0.9482954144477844, 0.5508551597595215]);
        arr2.reshape(1, 3);

        let mut result =
            Array::from(vec![-0.07805216312408447, -0.5199633836746216, -0.2854039967060089]);
        result.reshape(1, 3);

        assert!(allclose(&arr1.sub(&arr2), &result));

        arr1.sub_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_times_5() {

        let mut arr1 =
            Array::from(vec![0.9063590168952942, 0.42833206057548523, 0.2654511630535126]);
        arr1.reshape(1, 3);

        let mut arr2 =
            Array::from(vec![0.9844111800193787, 0.9482954144477844, 0.5508551597595215]);
        arr2.reshape(1, 3);

        let mut result =
            Array::from(vec![0.8922299742698669, 0.4061853289604187, 0.14622513949871063]);
        result.reshape(1, 3);

        assert!(allclose(&arr1.times(&arr2), &result));

        arr1.times_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_div_5() {

        let mut arr1 =
            Array::from(vec![0.9063590168952942, 0.42833206057548523, 0.2654511630535126]);
        arr1.reshape(1, 3);

        let mut arr2 =
            Array::from(vec![0.9844111800193787, 0.9482954144477844, 0.5508551597595215]);
        arr2.reshape(1, 3);

        let mut result =
            Array::from(vec![0.9207118153572083, 0.4516863226890564, 0.4818892180919647]);
        result.reshape(1, 3);

        assert!(allclose(&arr1.div(&arr2), &result));

        arr1.div_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_add_6() {

        let mut arr1 = Array::from(vec![0.23602057993412018,
                                        0.07694604992866516,
                                        0.982704222202301,
                                        0.7931925058364868,
                                        0.23201315104961395]);
        arr1.reshape(5, 1);

        let mut arr2 = Array::from(vec![0.007808223832398653,
                                        0.6496497988700867,
                                        0.40739911794662476,
                                        0.8071744441986084,
                                        0.7914289832115173]);
        arr2.reshape(5, 1);

        let mut result = Array::from(vec![0.24382880330085754,
                                          0.7265958786010742,
                                          1.3901033401489258,
                                          1.6003669500350952,
                                          1.0234421491622925]);
        result.reshape(5, 1);

        assert!(allclose(&arr1.add(&arr2), &result));

        arr1.add_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_sub_6() {

        let mut arr1 = Array::from(vec![0.23602057993412018,
                                        0.07694604992866516,
                                        0.982704222202301,
                                        0.7931925058364868,
                                        0.23201315104961395]);
        arr1.reshape(5, 1);

        let mut arr2 = Array::from(vec![0.007808223832398653,
                                        0.6496497988700867,
                                        0.40739911794662476,
                                        0.8071744441986084,
                                        0.7914289832115173]);
        arr2.reshape(5, 1);

        let mut result = Array::from(vec![0.2282123565673828,
                                          -0.5727037191390991,
                                          0.5753051042556763,
                                          -0.013981938362121582,
                                          -0.5594158172607422]);
        result.reshape(5, 1);

        assert!(allclose(&arr1.sub(&arr2), &result));

        arr1.sub_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_times_6() {

        let mut arr1 = Array::from(vec![0.23602057993412018,
                                        0.07694604992866516,
                                        0.982704222202301,
                                        0.7931925058364868,
                                        0.23201315104961395]);
        arr1.reshape(5, 1);

        let mut arr2 = Array::from(vec![0.007808223832398653,
                                        0.6496497988700867,
                                        0.40739911794662476,
                                        0.8071744441986084,
                                        0.7914289832115173]);
        arr2.reshape(5, 1);

        let mut result = Array::from(vec![0.0018429014598950744,
                                          0.04998798668384552,
                                          0.4003528356552124,
                                          0.640244722366333,
                                          0.18362192809581757]);
        result.reshape(5, 1);

        assert!(allclose(&arr1.times(&arr2), &result));

        arr1.times_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_div_6() {

        let mut arr1 = Array::from(vec![0.23602057993412018,
                                        0.07694604992866516,
                                        0.982704222202301,
                                        0.7931925058364868,
                                        0.23201315104961395]);
        arr1.reshape(5, 1);

        let mut arr2 = Array::from(vec![0.007808223832398653,
                                        0.6496497988700867,
                                        0.40739911794662476,
                                        0.8071744441986084,
                                        0.7914289832115173]);
        arr2.reshape(5, 1);

        let mut result = Array::from(vec![30.2271785736084,
                                          0.1184423491358757,
                                          2.4121413230895996,
                                          0.9826779365539551,
                                          0.2931572496891022]);
        result.reshape(5, 1);

        assert!(allclose(&arr1.div(&arr2), &result));

        arr1.div_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_add_7() {

        let mut arr1 =
            Array::from(vec![0.16539278626441956, 0.18947423994541168, 0.44509610533714294]);
        arr1.reshape(1, 3);

        let mut arr2 =
            Array::from(vec![0.3894217014312744, 0.22505198419094086, 0.004766093101352453]);
        arr2.reshape(1, 3);

        let mut result =
            Array::from(vec![0.5548144578933716, 0.41452622413635254, 0.44986221194267273]);
        result.reshape(1, 3);

        assert!(allclose(&arr1.add(&arr2), &result));

        arr1.add_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_sub_7() {

        let mut arr1 =
            Array::from(vec![0.16539278626441956, 0.18947423994541168, 0.44509610533714294]);
        arr1.reshape(1, 3);

        let mut arr2 =
            Array::from(vec![0.3894217014312744, 0.22505198419094086, 0.004766093101352453]);
        arr2.reshape(1, 3);

        let mut result =
            Array::from(vec![-0.22402891516685486, -0.035577744245529175, 0.44032999873161316]);
        result.reshape(1, 3);

        assert!(allclose(&arr1.sub(&arr2), &result));

        arr1.sub_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_times_7() {

        let mut arr1 =
            Array::from(vec![0.16539278626441956, 0.18947423994541168, 0.44509610533714294]);
        arr1.reshape(1, 3);

        let mut arr2 =
            Array::from(vec![0.3894217014312744, 0.22505198419094086, 0.004766093101352453]);
        arr2.reshape(1, 3);

        let mut result =
            Array::from(vec![0.06440754234790802, 0.04264155402779579, 0.0021213695872575045]);
        result.reshape(1, 3);

        assert!(allclose(&arr1.times(&arr2), &result));

        arr1.times_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_div_7() {

        let mut arr1 =
            Array::from(vec![0.16539278626441956, 0.18947423994541168, 0.44509610533714294]);
        arr1.reshape(1, 3);

        let mut arr2 =
            Array::from(vec![0.3894217014312744, 0.22505198419094086, 0.004766093101352453]);
        arr2.reshape(1, 3);

        let mut result =
            Array::from(vec![0.4247138500213623, 0.8419132232666016, 93.38804626464844]);
        result.reshape(1, 3);

        assert!(allclose(&arr1.div(&arr2), &result));

        arr1.div_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_add_8() {

        let mut arr1 = Array::from(vec![0.9972392320632935, 0.5522454977035522]);
        arr1.reshape(2, 1);

        let mut arr2 = Array::from(vec![0.3432486057281494, 0.7847270369529724]);
        arr2.reshape(2, 1);

        let mut result = Array::from(vec![1.3404878377914429, 1.3369724750518799]);
        result.reshape(2, 1);

        assert!(allclose(&arr1.add(&arr2), &result));

        arr1.add_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_sub_8() {

        let mut arr1 = Array::from(vec![0.9972392320632935, 0.5522454977035522]);
        arr1.reshape(2, 1);

        let mut arr2 = Array::from(vec![0.3432486057281494, 0.7847270369529724]);
        arr2.reshape(2, 1);

        let mut result = Array::from(vec![0.653990626335144, -0.23248153924942017]);
        result.reshape(2, 1);

        assert!(allclose(&arr1.sub(&arr2), &result));

        arr1.sub_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_times_8() {

        let mut arr1 = Array::from(vec![0.9972392320632935, 0.5522454977035522]);
        arr1.reshape(2, 1);

        let mut arr2 = Array::from(vec![0.3432486057281494, 0.7847270369529724]);
        arr2.reshape(2, 1);

        let mut result = Array::from(vec![0.34230098128318787, 0.4333619773387909]);
        result.reshape(2, 1);

        assert!(allclose(&arr1.times(&arr2), &result));

        arr1.times_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_div_8() {

        let mut arr1 = Array::from(vec![0.9972392320632935, 0.5522454977035522]);
        arr1.reshape(2, 1);

        let mut arr2 = Array::from(vec![0.3432486057281494, 0.7847270369529724]);
        arr2.reshape(2, 1);

        let mut result = Array::from(vec![2.90529727935791, 0.7037421464920044]);
        result.reshape(2, 1);

        assert!(allclose(&arr1.div(&arr2), &result));

        arr1.div_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_add_9() {

        let mut arr1 = Array::from(vec![0.881397008895874, 0.8563252687454224]);
        arr1.reshape(2, 1);

        let mut arr2 = Array::from(vec![0.31069085001945496, 0.7450122833251953]);
        arr2.reshape(2, 1);

        let mut result = Array::from(vec![1.1920878887176514, 1.6013375520706177]);
        result.reshape(2, 1);

        assert!(allclose(&arr1.add(&arr2), &result));

        arr1.add_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_sub_9() {

        let mut arr1 = Array::from(vec![0.881397008895874, 0.8563252687454224]);
        arr1.reshape(2, 1);

        let mut arr2 = Array::from(vec![0.31069085001945496, 0.7450122833251953]);
        arr2.reshape(2, 1);

        let mut result = Array::from(vec![0.5707061290740967, 0.11131298542022705]);
        result.reshape(2, 1);

        assert!(allclose(&arr1.sub(&arr2), &result));

        arr1.sub_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_times_9() {

        let mut arr1 = Array::from(vec![0.881397008895874, 0.8563252687454224]);
        arr1.reshape(2, 1);

        let mut arr2 = Array::from(vec![0.31069085001945496, 0.7450122833251953]);
        arr2.reshape(2, 1);

        let mut result = Array::from(vec![0.2738419771194458, 0.6379728317260742]);
        result.reshape(2, 1);

        assert!(allclose(&arr1.times(&arr2), &result));

        arr1.times_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



    #[test]
    fn test_array_op_div_9() {

        let mut arr1 = Array::from(vec![0.881397008895874, 0.8563252687454224]);
        arr1.reshape(2, 1);

        let mut arr2 = Array::from(vec![0.31069085001945496, 0.7450122833251953]);
        arr2.reshape(2, 1);

        let mut result = Array::from(vec![2.8368940353393555, 1.1494109630584717]);
        result.reshape(2, 1);

        assert!(allclose(&arr1.div(&arr2), &result));

        arr1.div_inplace(&arr2);
        assert!(allclose(&arr1, &result));
    }



}
